tazpkg rev 504

tazpkg: add some command switch (ex: install|-i)
author Christophe Lincoln <pankso@slitaz.org>
date Thu Jun 02 03:31:44 2011 +0200 (2011-06-02)
parents 8db26a7c509c
children 9bf228335345
files tazpkg
line diff
     1.1 --- a/tazpkg	Thu Jun 02 03:25:52 2011 +0200
     1.2 +++ b/tazpkg	Thu Jun 02 03:31:44 2011 +0200
     1.3 @@ -91,19 +91,19 @@
     1.4  \033[1m`gettext \"Commands\"`: \033[0m
     1.5    usage            `gettext \"Print this short usage.\"`
     1.6    bugs             `gettext \"Show known bugs in packages.\"`
     1.7 -  list             `gettext \"List installed packages on the system by category or all.\"`
     1.8 +  list|-           `gettext \"List installed packages on the system by category or all.\"`
     1.9    xhtml-list       `gettext \"Create a xHTML list of installed packages.\"`
    1.10    list-mirror      `gettext \"List all available packages on the mirror (--diff for new).\"`
    1.11    info             `gettext \"Print information about a package.\"`
    1.12    desc             `gettext \"Print description of a package (if it exists).\"`
    1.13    list-files       `gettext \"List the files installed with a package.\"`
    1.14    list-config      `gettext \"List the configuration files.\"`
    1.15 -  search           `gettext \"Search for a package by pattern or name (options: -i|-l|-m).\"`
    1.16 +  search|-s        `gettext \"Search for a package by pattern or name (options: -i|-l|-m).\"`
    1.17    search-pkgname   `gettext \"Search on mirror for package having a particular file.\"`
    1.18    search-file	   `gettext \"Search for file(s) in all installed packages files.\"`
    1.19 -  install          `gettext \"Install a local (*.tazpkg) package (--forced to force).\"`
    1.20 +  install|-i       `gettext \"Install a local (*.tazpkg) package (--forced to force).\"`
    1.21    install-list     `gettext \"Install all packages from a list of packages.\"`
    1.22 -  remove           `gettext \"Remove the specified package and all installed files.\"`
    1.23 +  remove|-r        `gettext \"Remove the specified package and all installed files.\"`
    1.24    extract          `gettext \"Extract a (*.tazpkg) package into a directory.\"`
    1.25    pack             `gettext \"Pack an unpacked or prepared package tree.\"`
    1.26    recharge         `gettext \"Recharge your packages.list from the mirror.\"`
    1.27 @@ -113,13 +113,13 @@
    1.28    recompress       `gettext \"Rebuild a package with a better compression ratio.\"`
    1.29    block|unblock    `gettext \"Block an installed package version or unblock it for upgrade.\"`
    1.30    get              `gettext \"Download a package into the current directory.\"`
    1.31 -  get-install      `gettext \"Download and install a package from the mirror.\"`
    1.32 +  get-install|-gi  `gettext \"Download and install a package from the mirror.\"`
    1.33    get-install-list `gettext \"Download and install a list of packages from the mirror.\"`
    1.34    check            `gettext \"Verify consistency of installed packages.\"`
    1.35    add-flavor       `gettext \"Install the flavor list of packages.\"`
    1.36    install-flavor   `gettext \"Install the flavor list of packages and remove other ones.\"`
    1.37    set-release      `gettext \"Change release and update packages.\"`
    1.38 -  clean-cache      `gettext \"Clean all packages downloaded in cache directory.\"`
    1.39 +  clean-cache|-cc  `gettext \"Clean all packages downloaded in cache directory.\"`
    1.40    depends          `gettext \"Display dependencies tree.\"`
    1.41    rdepends         `gettext \"Display reverse dependencies tree.\"`
    1.42    convert          `gettext \"Convert a deb/rpm/tgz/arch package to a slitaz (.tazpkg).\"`
    1.43 @@ -1445,7 +1445,7 @@
    1.44  ###################
    1.45  
    1.46  case "$COMMAND" in
    1.47 -	list)
    1.48 +	list|-l)
    1.49  		# List all installed packages or a specific category.
    1.50  		if [ "$2" = "blocked" ]; then
    1.51  			echo ""
    1.52 @@ -1639,7 +1639,7 @@
    1.53  			gettext "Sorry, no description available for this package."; echo
    1.54  			echo ""
    1.55  		fi ;;
    1.56 -	search)
    1.57 +	search|-s)
    1.58  		# Search for a package by pattern or name.
    1.59  		PATTERN="$2"
    1.60  		if [ -z "$PATTERN" ]; then
    1.61 @@ -1756,7 +1756,7 @@
    1.62  			echo ""
    1.63  		fi
    1.64  		;;
    1.65 -	install)
    1.66 +	install|-i)
    1.67  		# Install .tazpkg packages.
    1.68  		check_root
    1.69  		check_for_package_on_cmdline
    1.70 @@ -1864,7 +1864,7 @@
    1.71  				[ -d $j ] || tazpkg get-install $j
    1.72  			done
    1.73  		done ;;
    1.74 -	remove)
    1.75 +	remove|-r)
    1.76  		# Remove packages.
    1.77  		check_root
    1.78  		check_for_package_on_cmdline
    1.79 @@ -2621,7 +2621,7 @@
    1.80  		PACKAGE_FILE=$CACHE_DIR/$PACKAGE.tazpkg
    1.81  		cp -a $PACKAGE_FILE $CURRENT_DIR
    1.82  		;;
    1.83 -	get-install)
    1.84 +	get-install|-gi)
    1.85  		# Download and install a package.
    1.86  		check_root
    1.87  		check_for_package_on_cmdline
    1.88 @@ -2686,7 +2686,7 @@
    1.89  		[ "$AUTOEXEC" != "no" ] && $PACKAGE $ROOT 
    1.90  		update_desktop_database $ROOT 
    1.91  		update_mime_database $ROOT ;;
    1.92 -	clean-cache)
    1.93 +	clean-cache|-cc)
    1.94  		# Remove all downloaded packages.
    1.95  		check_root
    1.96  		files=$(find $CACHE_DIR -name *.tazpkg | wc -l)
    1.97 @@ -2833,7 +2833,7 @@
    1.98  		if [ -f $2/receipt ]; then
    1.99  			rdep_scan $2
   1.100  		fi ;;
   1.101 -	convert)
   1.102 +	convert|-c)
   1.103  		# convert misc package format to .tazpkg
   1.104  		check_for_package_file
   1.105  		if [ "$(dd if=$PACKAGE_FILE bs=8 count=1 skip=1 2> /dev/null)" \