Use 'pkg' as shorter form of 'packages'

Fixes https://github.com/termux/termux-app/issues/321.
This commit is contained in:
Fredrik Fornwall 2017-06-12 03:01:09 +02:00
parent ecff2cea84
commit 700ecf0fbc
6 changed files with 102 additions and 19 deletions

View File

@ -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.22 TERMUX_PKG_VERSION=1.23
termux_step_make_install () { termux_step_make_install () {
TERMUX_LIBEXEC_DIR=$TERMUX_PREFIX/libexec/termux TERMUX_LIBEXEC_DIR=$TERMUX_PREFIX/libexec/termux

View File

@ -42,7 +42,7 @@ 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 packages install %s\n", binary_name, current_package); printf("The program '%s' is not installed. Install it by executing:\n pkg install %s\n", binary_name, current_package);
return 127; return 127;
} else if (best_distance == distance) { } else if (best_distance == distance) {
guesses_at_best_distance++; guesses_at_best_distance++;

View File

@ -8,6 +8,24 @@ char const* const commands[] = {
" abook", " abook",
"angband", "angband",
" angband", " angband",
"apache2",
" ab",
" apachectl",
" apxs",
" checkgid",
" dbmmanage",
" envvars",
" envvars-std",
" fcgistarter",
" htcacheclean",
" htdbm",
" htdigest",
" htpasswd",
" httpd",
" httxt2dbm",
" logresolve",
" rotatelogs",
" suexec",
"apt", "apt",
" apt", " apt",
" apt-cache", " apt-cache",
@ -227,6 +245,9 @@ char const* const commands[] = {
" corkscrew", " corkscrew",
"cppi", "cppi",
" cppi", " cppi",
"cscope",
" cscope",
" ocs",
"ctags", "ctags",
" ctags", " ctags",
" readtags", " readtags",
@ -249,6 +270,7 @@ char const* const commands[] = {
"db", "db",
" db_archive", " db_archive",
" db_checkpoint", " db_checkpoint",
" db_convert",
" db_deadlock", " db_deadlock",
" db_dump", " db_dump",
" db_hotbackup", " db_hotbackup",
@ -271,6 +293,8 @@ char const* const commands[] = {
" savelog", " savelog",
" tempfile", " tempfile",
" which", " which",
"debootstrap",
" debootstrap",
"dialog", "dialog",
" dialog", " dialog",
" whiptail", " whiptail",
@ -335,7 +359,7 @@ char const* const commands[] = {
"emacs", "emacs",
" ebrowse", " ebrowse",
" emacs", " emacs",
" emacs-25.1", " emacs-25.2",
" emacsclient", " emacsclient",
" etags", " etags",
"erlang", "erlang",
@ -435,8 +459,34 @@ char const* const commands[] = {
" gdk-pixbuf-pixdata", " gdk-pixbuf-pixdata",
" gdk-pixbuf-query-loaders", " gdk-pixbuf-query-loaders",
" gdk-pixbuf-thumbnailer", " gdk-pixbuf-thumbnailer",
"gegl",
" gegl",
" gegl-imgcmp",
"getconf", "getconf",
" getconf", " getconf",
"gettext",
" autopoint",
" envsubst",
" gettext",
" gettext.sh",
" gettextize",
" msgattrib",
" msgcat",
" msgcmp",
" msgcomm",
" msgconv",
" msgen",
" msgexec",
" msgfilter",
" msgfmt",
" msggrep",
" msginit",
" msgmerge",
" msgunfmt",
" msguniq",
" ngettext",
" recode-sr-latin",
" xgettext",
"gifsicle", "gifsicle",
" gifdiff", " gifdiff",
" gifsicle", " gifsicle",
@ -471,6 +521,23 @@ char const* const commands[] = {
" gnuchess", " gnuchess",
"gnugo", "gnugo",
" gnugo", " gnugo",
"gnuit",
" .gitaction",
" gitaction",
" gitdpkgname",
" gitfm",
" gitkeys",
" gitmkdirs",
" gitmount",
" gitps",
" gitregrep",
" gitrfgrep",
" gitrgrep",
" gitunpack",
" gitview",
" gitwhich",
" gitwipe",
" gitxgrep",
"gnupg", "gnupg",
" gpg", " gpg",
" gpg-zip", " gpg-zip",
@ -580,6 +647,8 @@ char const* const commands[] = {
" ht", " ht",
"htop", "htop",
" htop", " htop",
"httping",
" httping",
"hub", "hub",
" hub", " hub",
"hunspell", "hunspell",
@ -604,6 +673,7 @@ char const* const commands[] = {
" iconv", " iconv",
"icu-devtools", "icu-devtools",
" derb", " derb",
" escapesrc",
" genbrk", " genbrk",
" genccode", " genccode",
" gencfu", " gencfu",
@ -661,6 +731,9 @@ char const* const commands[] = {
" rjoe", " rjoe",
"jq", "jq",
" jq", " jq",
"json-glib",
" json-glib-format",
" json-glib-validate",
"jupp", "jupp",
" jmacs", " jmacs",
" joe", " joe",
@ -699,6 +772,8 @@ char const* const commands[] = {
" sserver", " sserver",
" uuclient", " uuclient",
" uuserver", " uuserver",
"ledger",
" ledger",
"leptonica", "leptonica",
" convertfilestopdf", " convertfilestopdf",
" convertfilestops", " convertfilestops",
@ -888,13 +963,6 @@ char const* const commands[] = {
" opt", " opt",
" verify-uselistorder", " verify-uselistorder",
" yaml2obj", " yaml2obj",
"lrzsz",
" lrb",
" lrx",
" lrz",
" lsb",
" lsx",
" lsz",
"ltrace", "ltrace",
" ltrace", " ltrace",
"lua", "lua",
@ -927,6 +995,8 @@ char const* const commands[] = {
" mcdiff", " mcdiff",
" mcedit", " mcedit",
" mcview", " mcview",
"memcached",
" memcached",
"micro", "micro",
" micro", " micro",
"minicom", "minicom",
@ -953,6 +1023,8 @@ char const* const commands[] = {
" mp3splt", " mp3splt",
"mpc", "mpc",
" mpc", " mpc",
"mpd",
" mpd",
"mpv", "mpv",
" mpv", " mpv",
"multitail", "multitail",
@ -968,6 +1040,8 @@ char const* const commands[] = {
" ncdc", " ncdc",
"ncdu", "ncdu",
" ncdu", " ncdu",
"ncmpcpp",
" ncmpcpp",
"ncurses-utils", "ncurses-utils",
" clear", " clear",
" infocmp", " infocmp",
@ -1415,6 +1489,8 @@ char const* const commands[] = {
" par2verify", " par2verify",
"patch", "patch",
" patch", " patch",
"patchelf",
" patchelf",
"perl", "perl",
" c2ph", " c2ph",
" corelist", " corelist",
@ -1646,6 +1722,9 @@ char const* const commands[] = {
" rake", " rake",
" rdoc", " rdoc",
" ruby", " ruby",
"screen",
" screen",
" screen-4.5.1",
"scrypt", "scrypt",
" scrypt", " scrypt",
"sed", "sed",
@ -1673,6 +1752,10 @@ char const* const commands[] = {
" soxi", " soxi",
"sqlite", "sqlite",
" sqlite3", " sqlite3",
"squid",
" purge",
" squid",
" squidclient",
"sshpass", "sshpass",
" sshpass", " sshpass",
"sslscan", "sslscan",
@ -1698,8 +1781,6 @@ char const* const commands[] = {
" svnversion", " svnversion",
"syncthing", "syncthing",
" syncthing", " syncthing",
"tack",
" tack",
"tar", "tar",
" tar", " tar",
"tasksh", "tasksh",
@ -1762,6 +1843,8 @@ char const* const commands[] = {
" tig", " tig",
"timewarrior", "timewarrior",
" timew", " timew",
"tintin++",
" tt++",
"tinyscheme", "tinyscheme",
" tinyscheme", " tinyscheme",
"tmate", "tmate",
@ -2057,7 +2140,6 @@ char const* const commands[] = {
" vigpg", " vigpg",
" wifi-status", " wifi-status",
"colordiff", "colordiff",
" cdiff",
" colordiff", " colordiff",
"cowsay", "cowsay",
" cowsay", " cowsay",

View File

@ -1,6 +1,6 @@
TERMUX_PKG_HOMEPAGE=https://termux.com/ TERMUX_PKG_HOMEPAGE=https://termux.com/
TERMUX_PKG_DESCRIPTION="Basic system tools for Termux" TERMUX_PKG_DESCRIPTION="Basic system tools for Termux"
TERMUX_PKG_VERSION=0.42 TERMUX_PKG_VERSION=0.43
TERMUX_PKG_PLATFORM_INDEPENDENT=yes TERMUX_PKG_PLATFORM_INDEPENDENT=yes
TERMUX_PKG_CONFFILES="etc/motd" TERMUX_PKG_CONFFILES="etc/motd"
@ -18,10 +18,11 @@ termux_step_make_install () {
chmod +x $TERMUX_PREFIX/bin/$tool chmod +x $TERMUX_PREFIX/bin/$tool
done done
cp -p $TERMUX_PKG_BUILDER_DIR/{dalvikvm,su,termux-fix-shebang,termux-reload-settings,termux-setup-storage,chsh,termux-open-url,termux-wake-lock,termux-wake-unlock,login,packages,termux-open,termux-info} $TERMUX_PREFIX/bin/ cp -p $TERMUX_PKG_BUILDER_DIR/{dalvikvm,su,termux-fix-shebang,termux-reload-settings,termux-setup-storage,chsh,termux-open-url,termux-wake-lock,termux-wake-unlock,login,pkg,termux-open,termux-info} $TERMUX_PREFIX/bin/
perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dalvikvm perl -p -i -e "s%\@TERMUX_PREFIX\@%${TERMUX_PREFIX}%g" $TERMUX_PREFIX/bin/dalvikvm
cp $TERMUX_PKG_BUILDER_DIR/motd $TERMUX_PREFIX/etc/motd cp $TERMUX_PKG_BUILDER_DIR/motd $TERMUX_PREFIX/etc/motd
cd $TERMUX_PREFIX/bin cd $TERMUX_PREFIX/bin
ln -s -f termux-open xdg-open ln -s -f termux-open xdg-open
ln -s -f pkg packages
} }

View File

@ -6,7 +6,7 @@ IRC channel: #termux on freenode
Gitter chat: https://gitter.im/termux/termux Gitter chat: https://gitter.im/termux/termux
Mailing list: termux+subscribe@groups.io Mailing list: termux+subscribe@groups.io
Search packages: packages search <query> Search packages: pkg search <query>
Install a package: packages install <package> Install a package: pkg install <package>
Upgrade packages: packages upgrade Upgrade packages: pkg upgrade
Learn more: packages help Learn more: pkg help