[Bug 43558] New: Convert misc/cronjobs/longoverdue.pl to the Getopt::Long::Descriptive convention (see bug 43546)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43558 Bug ID: 43558 Summary: Convert misc/cronjobs/longoverdue.pl to the Getopt::Long::Descriptive convention (see bug 43546) 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: --- Convert the plain Getopt::Long option parsing in misc/cronjobs/longoverdue.pl to Koha::Script->describe_options, per the convention established by bug 43546. This script has three separate mutually-exclusive option pairs, each currently enforced with its own hand-rolled pod2usage check after parsing: - --category / --skip-category - --library / --skip-library - --itemtype / --skip-itemtype Depends on bug 43557 (declarative mutually-exclusive option support in Koha::Script->describe_options), so all three pairs can be declared rather than reimplemented as three near-identical post-parse checks. Test plan: 1. misc/cronjobs/longoverdue.pl --help Confirm the description and all options are documented. 2. For each of the three pairs, confirm supplying both options together is still rejected as mutually exclusive, and each option still works correctly on its own. 3. koha-qa.pl passes for the changed file. -- 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=43558 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- 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=43558 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 206175 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206175&action=edit Bug 43558: Convert longoverdue.pl to the Getopt::Long::Descriptive convention Convert the plain Getopt::Long option parsing to Koha::Script->describe_options, per the convention established by bug 43546. --category/--skip-category, --library/--skip-library, and --itemtype/--skip-itemtype are each declared exclusive (bug 43557), replacing three near-identical hand-rolled pod2usage checks. --lost's Getopt::Long::Descriptive spec is a hash type (=s%), matching its existing DAYS=LOST_CODE usage; --category/--skip-category/ --library/--skip-library/--itemtype/--skip-itemtype/--skip-lost-value all move from the "arrayref/array passed as the destination" trick (which accumulates regardless of the spec string) to an explicit @ type, since describe_options needs it declared, not inferred from the destination. No option here has a single-value shape worth a Params::Validate callback: the FIXMEs already in this file ("do checks on --lost ranges ...") describe validation this script has never had, not something this conversion adds, and the category/library/itemtype existence checks stay post-parse code (same reasoning as the sibling bugs -- they're DB lookups shared with building the skip/include table, not CLI-shape checks). Two minor, expected losses of alternate spellings, consistent with the other scripts already converted: -h no longer means --help (describe_options' auto-added help is always help|?, no short letter), and --manual no longer works as a --man alias (only --man). Both were undocumented-by-convention duplicate spellings, not the primary flag; updated the SYNOPSIS/OPTIONS POD to stop advertising them. Test plan: 1. longoverdue.pl --help / --man 2. longoverdue.pl --category X --skip-category Y (and the library/ itemtype equivalents) Each pair still rejected as mutually exclusive. 3. longoverdue.pl --list-categories / --list-itemtypes Still list and exit 0. 4. longoverdue.pl (no options, no DefaultLongOverdueLostValue/Days set) Still rejected: no --lost option or system preferences defined. 5. longoverdue.pl --lost 30=1 [--quiet] Still runs in TEST MODE (no --confirm) and prints the same report. 6. longoverdue.pl --lost 30=1 --category BADCODE Still rejected: category does not exist in the database. 7. koha-qa.pl passes. -- 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=43558 Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> changed: What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |Needs Signoff Assignee|koha-bugs@lists.koha-commun |martin.renvoize@openfifth.c |ity.org |o.uk -- You are receiving this mail because: You are watching all bug changes. You are the assignee for the bug.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org