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: koha-bugs@lists.koha-community.org Reporter: martin.renvoize@openfifth.co.uk QA Contact: testopia@bugs.koha-community.org CC: jake.deery@openfifth.co.uk, robin@catalyst.net.nz 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.