[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

Re: [PATCH 2/4] easy-build.sh: use getopts instead of rolling our own option parsing.



On Friday 07 August 2009, Ian Campbell wrote:
> +while getopts d:h OPT ; do

Is getopts also supported in dash?

> +       case $OPT in
> +           d)
> +               case $OPTARG in
> +               # Note: "gnome" is the special gnome task, not the generic task
> +                   gnome|kde|lxde|xfce|light|all) 
> +                       desktop=$2
> +                       ;;
> +                   *)
> +                       show_usage
> +                       exit 1
> +                       ;;
> +               esac ;;
> +           h) show_usage; exit 1;;

Please put the commands for the "h" option on separate lines (as is done
for the others).

AFAIK a plain 'show_usage', if not displayed as the result of an error,
should have an 'exit 0'.

The -h option should be listed in the usage output.

Maybe it would be good to also support --help if -h is added.

Reply to: