https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44127
Bug ID: 44127
Summary: Koha::Script->describe_options: restore the -h alias
for --help where it is free
Initiative type: ---
Sponsorship ---
status:
Product: Koha
Version: Main
Hardware: All
OS: All
Status: NEW
Severity: minor
Priority: P5 - low
Component: Command-line Utilities
Assignee: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected], [email protected]
Target Milestone: ---
Several cron scripts accepted -h as a short alias for --help under plain
Getopt::Long (cleanup_database.pl, gather_print_notices.pl, longoverdue.pl and
process_message_queue.pl declared 'h|help'). After their conversion to
Getopt::Long::Descriptive (bug 43546) Koha::Script->describe_options only
provides 'help|?', so -h is now an unknown option: it prints the usage text
with an error and exits 1 instead of exiting 0.
The alias cannot be added unconditionally, because some scripts use -h for
something else (cart_to_shelf.pl uses -h for --hours).
This bug makes describe_options add h as an alias of --help when none of the
script's own options is already called h.
Test plan:
1. Run prove t/Koha/Script.t
2. perl misc/cronjobs/longoverdue.pl -h
=> usage text, exit status 0
3. perl misc/cronjobs/cart_to_shelf.pl -h 1 --test
=> still treated as --hours, not help
--
You are receiving this mail because:
You are the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/