[Bugs] [Bug 1503983] Wrong usage of getopt shell command in hook-scripts

bugzilla at redhat.com bugzilla at redhat.com
Wed Oct 25 07:29:32 UTC 2017


https://bugzilla.redhat.com/show_bug.cgi?id=1503983



--- Comment #7 from Worker Ant <bugzilla-bot at gluster.org> ---
COMMIT: https://review.gluster.org/18548 committed in master by  

------------- extras/hooks: Fix getopt usage

`getopt` does not have an optional argument as '-name'. It should
be either '-n' or '--name'(see man getopt(1)). This wrong usage
resulted in setting the script name as 'ame' instead of $PROGNAME
in most of the hook-scripts.

Additionally the following line from DESCRIPTION given for `getopt`
shell command expects short options for almost every kind of usage
mentioned in SYNOPSIS:

. . .
If  no  '-o'  or '--options' option is found in the first part, the
first parameter of the second part is used as the short options string.
. . .

Refer http://man7.org/linux/man-pages/man1/getopt.1.html for more
clarity on its usage.

Change-Id: I95baf5fa8c99025e66b2d83656dd838d4f6048ce
BUG: 1503983
Signed-off-by: Anoop C S <anoopcs at redhat.com>

-- 
You are receiving this mail because:
You are on the CC list for the bug.
Unsubscribe from this bug https://bugzilla.redhat.com/token.cgi?t=9gZc10I3mJ&a=cc_unsubscribe


More information about the Bugs mailing list