Browse Source

command-not-found: Update with latest commands

android-5
Fredrik Fornwall 7 years ago
parent
commit
4f61067b8d
  1. 2
      packages/command-not-found/build.sh
  2. 11
      packages/command-not-found/command-not-found.c
  3. 115
      packages/command-not-found/commands.h

2
packages/command-not-found/build.sh

@ -1,6 +1,6 @@
TERMUX_PKG_HOMEPAGE=https://termux.com TERMUX_PKG_HOMEPAGE=https://termux.com
TERMUX_PKG_DESCRIPTION="Suggest installation of packages in interactive shell sessions" TERMUX_PKG_DESCRIPTION="Suggest installation of packages in interactive shell sessions"
TERMUX_PKG_VERSION=1.23 TERMUX_PKG_VERSION=1.24
termux_step_make_install () { termux_step_make_install () {
TERMUX_LIBEXEC_DIR=$TERMUX_PREFIX/libexec/termux TERMUX_LIBEXEC_DIR=$TERMUX_PREFIX/libexec/termux

11
packages/command-not-found/command-not-found.c

@ -42,8 +42,13 @@ int main(int argc, char** argv) {
char const* binary_name = current_line + 1; char const* binary_name = current_line + 1;
int distance = termux_levenshtein_distance(command_not_found, binary_name); int distance = termux_levenshtein_distance(command_not_found, binary_name);
if (distance == 0 && strcmp(command_not_found, binary_name) == 0) { if (distance == 0 && strcmp(command_not_found, binary_name) == 0) {
printf("The program '%s' is not installed. Install it by executing:\n pkg install %s\n", binary_name, current_package); if (best_distance == 0) {
return 127; printf("or\n");
} else {
printf("The program '%s' is not installed. Install it by executing:\n", binary_name);
}
printf(" pkg install %s\n", current_package);
best_distance = 0;
} else if (best_distance == distance) { } else if (best_distance == distance) {
guesses_at_best_distance++; guesses_at_best_distance++;
} else if (best_distance == -1 || best_distance > distance) { } else if (best_distance == -1 || best_distance > distance) {
@ -57,6 +62,8 @@ int main(int argc, char** argv) {
} }
} }
if (best_distance == 0) return 127;
if (best_distance == -1 || best_distance > 3) { if (best_distance == -1 || best_distance > 3) {
printf("%s: command not found\n", command_not_found); printf("%s: command not found\n", command_not_found);
} else { } else {

115
packages/command-not-found/commands.h

@ -6,6 +6,12 @@ char const* const commands[] = {
" abduco", " abduco",
"abook", "abook",
" abook", " abook",
"alpine",
" alpine",
" pico",
" pilot",
" rpdump",
" rpload",
"angband", "angband",
" angband", " angband",
"apache2", "apache2",
@ -26,6 +32,10 @@ char const* const commands[] = {
" logresolve", " logresolve",
" rotatelogs", " rotatelogs",
" suexec", " suexec",
"apr-dev",
" apr-1-config",
"apr-util-dev",
" apu-1-config",
"apt", "apt",
" apt", " apt",
" apt-cache", " apt-cache",
@ -104,6 +114,8 @@ char const* const commands[] = {
" bzip2recover", " bzip2recover",
" bzless", " bzless",
" bzmore", " bzmore",
"cadaver",
" cadaver",
"calcurse", "calcurse",
" calcurse", " calcurse",
" calcurse-caldav", " calcurse-caldav",
@ -253,6 +265,7 @@ char const* const commands[] = {
" readtags", " readtags",
"curl", "curl",
" curl", " curl",
" curl-config",
"curseofwar", "curseofwar",
" curseofwar", " curseofwar",
"cvs", "cvs",
@ -371,7 +384,6 @@ char const* const commands[] = {
" escript", " escript",
" run_erl", " run_erl",
" to_erl", " to_erl",
" typer",
"espeak", "espeak",
" espeak", " espeak",
"expect", "expect",
@ -380,6 +392,8 @@ char const* const commands[] = {
" timed-read", " timed-read",
" timed-run", " timed-run",
" unbuffer", " unbuffer",
"fdupes",
" fdupes",
"ffmpeg", "ffmpeg",
" ffmpeg", " ffmpeg",
" ffprobe", " ffprobe",
@ -424,6 +438,8 @@ char const* const commands[] = {
" fortune", " fortune",
"fossil", "fossil",
" fossil", " fossil",
"freetype-dev",
" freetype-config",
"frobtads", "frobtads",
" frob", " frob",
" t3make", " t3make",
@ -458,7 +474,6 @@ char const* const commands[] = {
" gdk-pixbuf-csource", " gdk-pixbuf-csource",
" gdk-pixbuf-pixdata", " gdk-pixbuf-pixdata",
" gdk-pixbuf-query-loaders", " gdk-pixbuf-query-loaders",
" gdk-pixbuf-thumbnailer",
"gegl", "gegl",
" gegl", " gegl",
" gegl-imgcmp", " gegl-imgcmp",
@ -573,6 +588,8 @@ char const* const commands[] = {
" gofmt", " gofmt",
"gpgme", "gpgme",
" gpgme-tool", " gpgme-tool",
"gpgme-dev",
" gpgme-config",
"gpgv", "gpgv",
" gpgv", " gpgv",
"graphicsmagick", "graphicsmagick",
@ -772,6 +789,8 @@ char const* const commands[] = {
" sserver", " sserver",
" uuclient", " uuclient",
" uuserver", " uuserver",
"ldns-dev",
" ldns-config",
"ledger", "ledger",
" ledger", " ledger",
"leptonica", "leptonica",
@ -795,6 +814,8 @@ char const* const commands[] = {
"lftp", "lftp",
" lftp", " lftp",
" lftpget", " lftpget",
"libassuan-dev",
" libassuan-config",
"libcaca", "libcaca",
" caca-config", " caca-config",
" cacaclock", " cacaclock",
@ -831,6 +852,21 @@ char const* const commands[] = {
"libgpg-error", "libgpg-error",
" gpg-error", " gpg-error",
" gpg-error-config", " gpg-error-config",
"libgrpc",
" check_epollexclusive",
" gen_hpack_tables",
" gen_legal_metadata_characters",
" gen_percent_encoding_tables",
" grpc_cpp_plugin",
" grpc_create_jwt",
" grpc_csharp_plugin",
" grpc_node_plugin",
" grpc_objective_c_plugin",
" grpc_php_plugin",
" grpc_print_google_default_creds_token",
" grpc_python_plugin",
" grpc_ruby_plugin",
" grpc_verify_jwt",
"libjasper-utils", "libjasper-utils",
" imgcmp", " imgcmp",
" imginfo", " imginfo",
@ -842,6 +878,8 @@ char const* const commands[] = {
" rdjpgcom", " rdjpgcom",
" tjbench", " tjbench",
" wrjpgcom", " wrjpgcom",
"libksba-dev",
" ksba-config",
"libmp3lame", "libmp3lame",
" lame", " lame",
"libnpth", "libnpth",
@ -867,6 +905,9 @@ char const* const commands[] = {
" otr_readforge", " otr_readforge",
" otr_remac", " otr_remac",
" otr_sesskeys", " otr_sesskeys",
"libpng-dev",
" libpng-config",
" libpng16-config",
"librsvg", "librsvg",
" rsvg-convert", " rsvg-convert",
"libsndfile", "libsndfile",
@ -988,6 +1029,54 @@ char const* const commands[] = {
" mandoc", " mandoc",
" soelim", " soelim",
" whatis", " whatis",
"mariadb",
" aria_chk",
" aria_dump_log",
" aria_ftdump",
" aria_pack",
" aria_read_log",
" innochecksum",
" mariadb_config",
" msql2mysql",
" my_print_defaults",
" myisam_ftdump",
" myisamchk",
" myisamlog",
" myisampack",
" mysql",
" mysql_client_test",
" mysql_client_test_embedded",
" mysql_config",
" mysql_convert_table_format",
" mysql_embedded",
" mysql_find_rows",
" mysql_fix_extensions",
" mysql_install_db",
" mysql_plugin",
" mysql_secure_installation",
" mysql_setpermission",
" mysql_tzinfo_to_sql",
" mysql_upgrade",
" mysql_waitpid",
" mysqlaccess",
" mysqladmin",
" mysqlbinlog",
" mysqlcheck",
" mysqld",
" mysqld_multi",
" mysqld_safe",
" mysqld_safe_helper",
" mysqldump",
" mysqldumpslow",
" mysqlhotcopy",
" mysqlimport",
" mysqlshow",
" mysqlslap",
" mytop",
" perror",
" replace",
" resolve_stack_dump",
" resolveip",
"mathomatic", "mathomatic",
" mathomatic", " mathomatic",
"mc", "mc",
@ -1009,6 +1098,8 @@ char const* const commands[] = {
" updatedb", " updatedb",
"moon-buggy", "moon-buggy",
" moon-buggy", " moon-buggy",
"moria",
" moria",
"mosh", "mosh",
" mosh", " mosh",
" mosh-client", " mosh-client",
@ -1448,6 +1539,10 @@ char const* const commands[] = {
"nodejs", "nodejs",
" node", " node",
" npm", " npm",
"nodejs-current",
" node",
" npm",
" npx",
"notmuch", "notmuch",
" notmuch", " notmuch",
"ocrad", "ocrad",
@ -1491,8 +1586,9 @@ char const* const commands[] = {
" patch", " patch",
"patchelf", "patchelf",
" patchelf", " patchelf",
"pcre-dev",
" pcre-config",
"perl", "perl",
" c2ph",
" corelist", " corelist",
" cpan", " cpan",
" enc2xs", " enc2xs",
@ -1516,7 +1612,6 @@ char const* const commands[] = {
" podchecker", " podchecker",
" podselect", " podselect",
" prove", " prove",
" pstruct",
" ptar", " ptar",
" ptardiff", " ptardiff",
" ptargrep", " ptargrep",
@ -1702,7 +1797,6 @@ char const* const commands[] = {
" redis-sentinel", " redis-sentinel",
" redis-server", " redis-server",
"remind", "remind",
" cm2rem.tcl",
" rem", " rem",
" rem2ps", " rem2ps",
" remind", " remind",
@ -1724,7 +1818,7 @@ char const* const commands[] = {
" ruby", " ruby",
"screen", "screen",
" screen", " screen",
" screen-4.5.1", " screen-4.6.1",
"scrypt", "scrypt",
" scrypt", " scrypt",
"sed", "sed",
@ -1837,14 +1931,6 @@ char const* const commands[] = {
" texi2dvi", " texi2dvi",
" texi2pdf", " texi2pdf",
" texindex", " texindex",
"texlive",
" bibtex",
" lualatex",
" makeindex",
" pdflatex",
" texliveonfly",
" tlmgr",
" xelatex",
"tig", "tig",
" tig", " tig",
"timewarrior", "timewarrior",
@ -2214,6 +2300,7 @@ char const* const commands[] = {
" packages", " packages",
" ping", " ping",
" ping6", " ping6",
" pkg",
" pm", " pm",
" settings", " settings",
" su", " su",

Loading…
Cancel
Save