[Bug 44127] New: Koha::Script->describe_options: restore the -h alias for --help where it is free
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.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44127 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk Depends on| |43557 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43557 [Bug 43557] Add declarative mutually-exclusive option support to Koha::Script->describe_options -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44127 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Blocks| |43560 Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43560 [Bug 43560] Convert misc/cronjobs/update_totalissues.pl to the Getopt::Long::Descriptive convention (see bug 43546) -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44127 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 211739 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211739&action=edit Bug 44127: Restore the -h alias for --help in Koha::Script->describe_options cleanup_database.pl, gather_print_notices.pl, longoverdue.pl, process_message_queue.pl and update_totalissues.pl accepted -h as an alias for --help under plain Getopt::Long. After conversion to Getopt::Long::Descriptive (bug 43546) only --help and -? are provided, so -h printed the usage text with an error and exited 1. Add h as an alias of --help unless the script declares an option called h of its own (cart_to_shelf.pl uses -h for --hours). To test: 1. prove t/Koha/Script.t => Success 2. perl misc/cronjobs/longoverdue.pl -h => usage text, exit status 0 3. perl misc/cronjobs/cart_to_shelf.pl -h 1 => treated as --hours 1, not help Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44127 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff --- Comment #2 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Correction to the description's test plan: cart_to_shelf.pl has no --test option, so step 3 should be 'perl misc/cronjobs/cart_to_shelf.pl -h 1' (the attached patch's commit message has it right). -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44127 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|Needs Signoff |Signed Off -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44127 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- Attachment #211739|0 |1 is obsolete| | -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44127 --- Comment #3 from Andrew Fuerste-Henry <andrew@bywatersolutions.com> --- Created attachment 211744 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=211744&action=edit Bug 44127: Restore the -h alias for --help in Koha::Script->describe_options cleanup_database.pl, gather_print_notices.pl, longoverdue.pl, process_message_queue.pl and update_totalissues.pl accepted -h as an alias for --help under plain Getopt::Long. After conversion to Getopt::Long::Descriptive (bug 43546) only --help and -? are provided, so -h printed the usage text with an error and exited 1. Add h as an alias of --help unless the script declares an option called h of its own (cart_to_shelf.pl uses -h for --hours). To test: 1. prove t/Koha/Script.t => Success 2. perl misc/cronjobs/longoverdue.pl -h => usage text, exit status 0 3. perl misc/cronjobs/cart_to_shelf.pl -h 1 => treated as --hours 1, not help Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Signed-off-by: Andrew Fuerste Henry <andrew@bywatersolutions.com> -- You are receiving this mail because: You are watching all bug changes.
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44127 Andrew Fuerste-Henry <andrew@bywatersolutions.com> changed: What |Removed |Added ---------------------------------------------------------------------------- CC| |andrew@bywatersolutions.com QA Contact|testopia@bugs.koha-communit |pedro.amorim@openfifth.co.u |y.org |k -- You are receiving this mail because: You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org