[pacman-dev] [PATCH] contrib/paclist: Add "--help" command line parameter

Lukas Fleischer archlinux at cryptocrack.de
Fri Dec 2 19:44:53 EST 2011


On Fri, Dec 02, 2011 at 10:10:14AM -0600, Dan McGee wrote:
> On Fri, Dec 2, 2011 at 2:49 AM, Lukas Fleischer
> <archlinux at cryptocrack.de> wrote:
> > Be consistent with all other contrib scripts and support the "--help"
> > command line switch. Fixes FS#27258.
> Where are we on consistency here with what we expect out of scripts in
> scripts/? All of these support -h/--help/-V/--version; is it logical
> to require the same for scripts in contrib?

You surely know... :) I only saw that bug report and found it weird that
paclist displays a usage message if we pass no parameters but does
nothing when it is invoked with "-h" (as opposed to all other contrib
scripts).

> 
> > Signed-off-by: Lukas Fleischer <archlinux at cryptocrack.de>
> > ---
> >  contrib/paclist.in |    2 +-
> >  1 files changed, 1 insertions(+), 1 deletions(-)
> >
> > diff --git a/contrib/paclist.in b/contrib/paclist.in
> > index 84144f7..06b06f2 100755
> > --- a/contrib/paclist.in
> > +++ b/contrib/paclist.in
> > @@ -27,7 +27,7 @@ if ! type gettext &>/dev/null; then
> >        }
> >  fi
> >
> > -if [[ -z $1 ]]; then
> > +if [[ -z $1 || $1 = -@(h|-help) ]]; then
> >        printf '%s - List all packages installed from a given repo\n' "${0##*/}"
> >        printf 'Usage:   %s <repo>\n' "${0##*/}"
> >        printf 'Example: %s testing\n' "${0##*/}"
> > --
> > 1.7.7.4
> >
> >
> 


More information about the pacman-dev mailing list