Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 28 Jul 1997 17:25:43 -0600 (MDT)
From:      Brandon Gillespie <brandon@roguetrader.com>
To:        freebsd-hackers@freebsd.org
Subject:   pkg_* commands vs 'pkg' command
Message-ID:  <Pine.BSF.3.96.970728172106.318A-200000@roguetrader.com>

index | next in thread | raw e-mail

[-- Attachment #1 --]
Just curious, but does anybody else find having to use '_' in ANY command
clunky and unweildy?  I recently had to take a little bit of light flack
(nothing serious 8) from a debian linux user because they have a simple
'dpkg' command (I think it was).  In response to this I hacked up a simple
wrapper to the various 'pkg_' commands, and added a 'list' option as well
(see attachment).  This is just a shell script which I personally have
dropped in /usr/sbin/pkg (alongside the counterparts it execs).  Yeah, it
simply nixes the '_' in typing, but it saves a keystroke and stretch of
the finger--not to mention it feels better from a UI point of view :)

Has anybody ever considered unifying the various seperate package
commands?  At least in a manner similar to how mount is unified?  (i.e. 
seperate commands for specific things, but still one central command for
ease of use).

-Brandon Gillespie

[-- Attachment #2 --]
#!/bin/sh

cmd=""
args=""
syntax() {
    cat <<END
Syntax: pkg <add|del|list|create> [args]

Where [args] are add/del/list/create specific arguments.
END
}

if [ "$1" = "" ]; then
    syntax
    exit 1
fi

case $1 in
    list)
        cmd="pkg_info"
        args="$args -aI" ;;
    add)
        cmd="pkg_add" ;;
    del | delete | rm)
        cmd="pkg_delete" ;;
    create)
        cmd="pkg_create" ;;
    *)
        syntax ;;
esac

shift

exec $cmd $args $*
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.970728172106.318A-200000>