https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=44126 Bug ID: 44126 Summary: Koha::Script->describe_options: allow scripts to declare deprecated, ignored options Initiative type: --- Sponsorship --- status: Product: Koha Version: Main Hardware: All OS: All Status: NEW Severity: enhancement 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: --- Scripts converted to Getopt::Long::Descriptive (see bug 43546) now exit 1 on any unknown option. Plain Getopt::Long only printed an "Unknown option" warning, and scripts that did not check the return value of GetOptions carried on regardless. Where a script has dropped an option in the past (for example update_totalissues.pl and --commit, removed in 24.11), existing cron jobs that still pass it used to keep working with a warning. After conversion they exit 1 before doing any work, and since cron lines commonly redirect output to /dev/null, the failure is silent. This bug adds an opt-in 'deprecated_options' key to the meta hash of Koha::Script->describe_options. Each listed option (with or without a value) is stripped from @ARGV before parsing and a deprecation warning is printed to STDERR, in the same way as the existing legacy single-dash compatibility shim. Every other unknown option stays fatal, so typos on destructive scripts are still caught. Test plan: 1. Apply the patch and run prove t/Koha/Script.t 2. Confirm the new tests pass: a declared deprecated option is ignored with a warning, with and without a value (--foo, --foo=1, --foo 1), and an undeclared unknown option still exits 1. -- You are receiving this mail because: You are the assignee for the bug. You are watching all bug changes.