[Bug 43553] New: Convert misc/cronjobs/holds/holds_reminder.pl to the Getopt::Long::Descriptive convention (see bug 43546)
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43553 Bug ID: 43553 Summary: Convert misc/cronjobs/holds/holds_reminder.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 Depends on: 43546 Target Milestone: --- This is one of a set of bugs filed alongside bug 43546 (Standardize command-line scripts on Getopt::Long::Descriptive) to convert individual, commonly-used cron scripts to whatever declarative option-parsing convention that bug settles on. Depends on 43546. Current state: holds_reminder.pl uses plain Getopt::Long (GetOptions call around line 176). No option is required: --days defaults to 0, meaning all waiting holds, if omitted (around line 195); --library defaults to all branches if omitted; --date defaults to today and is only format-validated if actually supplied; --lettercode defaults to 'HOLD_REMINDER'. What this bug covers: convert the GetOptions call to the new convention purely for consistency and self-documenting --help output, matching bug 43546's convention. No behavior change is expected, since nothing here is actually a missing-required-option bug to fix. Test plan: - --help output covers all documented options and matches current behavior - Running with no options still behaves exactly as before (all branches, all waiting holds, today's date) Referenced Bugs: https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43546 [Bug 43546] Standardize command-line scripts on Getopt::Long::Descriptive for safer, more consistent option handling -- 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=43553 --- Comment #1 from Martin Renvoize (ashimema) <martin.renvoize@openfifth.co.uk> --- Created attachment 206185 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206185&action=edit Bug 43553: Convert holds_reminder.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. --lettercode's default moves into the option spec. Also adds a Params::Validate callback requiring --date to be a valid YYYY-MM-DD date (via Koha::DateUtils::dt_from_string), replacing the existing hand-rolled eval/die check with the same validation logic, now enforced consistently during option parsing with the usual usage text on failure, matching the pattern already used for --interval on bug 43560. Dropped $opt_out, a leftover variable that was declared but never wired to any option or used anywhere in the script -- dead code predating this conversion, not a behavior change. Updated the SYNOPSIS/OPTIONS POD to use the double-dash spelling for multi-letter options (--library, --days, etc.), matching what the new --help now displays; single-letter -v/-c/-t are unchanged. Left the "-n -csv" example in USAGE EXAMPLES alone -- it refers to options this script has never had (apparently copy-pasted from a different script's docs), predates this conversion, and isn't affected by it. Test plan: 1. holds_reminder.pl --help / --man 2. holds_reminder.pl --date not-a-date Rejected: --date must be a valid date in YYYY-MM-DD format. 3. holds_reminder.pl --date 2026-01-15 -v Runs to completion as before. 4. holds_reminder.pl -v (no options) Runs to completion exactly as before (today, all branches, all waiting holds). 5. holds_reminder.pl --library CPL --days 14 -v Runs to completion exactly as before. 6. koha-qa.pl passes. -- 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=43553 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 the assignee for the bug. You are watching all bug changes.
participants (1)
-
bugzilla-daemon@bugs.koha-community.org