https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43548
Bug ID: 43548
Summary: Convert misc/cronjobs/runreport.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: [email protected]
Reporter: [email protected]
QA Contact: [email protected]
CC: [email protected], [email protected]
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: runreport.pl uses plain Getopt::Long (GetOptions call around
line 210). No option here is actually mandatory -- --format defaults to 'text'
if omitted (around line 237); --to/--from/--email are only meaningful together
and default from the KohaAdminEmailAddress system preference if unset. The
script's real "you must supply something" requirement is a positional argument,
not a named option: at least one saved report ID must be passed via @ARGV,
enforced by "unless (scalar(@ARGV)) { pod2usage(1); }" around line 268.
What this bug covers: convert the GetOptions call to the new convention,
declaring each option's type and description explicitly, with none marked
required (matching current behavior -- nothing here is a false negative to
fix). Note for whoever picks this up: the positional report-ID requirement
doesn't map onto a simple per-option required flag, so it will likely need to
stay as manual validation after parsing, unless the convention from bug 43546
ends up handling leftover/positional arguments some other way -- check against
whatever pattern that bug lands on.
Test plan:
- --help output covers all documented options and matches current behavior
- Running with one or more report IDs still behaves exactly as before
- Running with zero report IDs still fails with a clear error
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 the assignee for the bug.
You are watching all bug changes.
_______________________________________________
Koha-bugs mailing list -- [email protected]
To unsubscribe send an email to [email protected]
website : http://www.koha-community.org/
git : http://git.koha-community.org/
bugs : http://bugs.koha-community.org/