https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43548
--- Comment #3 from Martin Renvoize (ashimema) <[email protected]> --- Created attachment 206083 --> https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206083&action=edit Bug 43548: Convert runreport.pl to the Getopt::Long::Descriptive convention Converts runreport.pl's GetOptions call to Koha::Script->describe_options (bug 43546), using the --man and args support added in the previous commit. No option here is genuinely mandatory -- --format defaults to 'text', --to/--from/--email default from KohaAdminEmailAddress, and the script's real requirement (at least one saved report ID) is a positional argument, declared via C<args => { min => 1, name => 'reportID', variadic => 1 }> rather than a manual "unless (@ARGV) { ... die }" check. Test plan: 1. Run: misc/cronjobs/runreport.pl --help Confirm it lists all documented options, the reportID argument, and usage examples, and exits 0. 2. Run: misc/cronjobs/runreport.pl --man Confirm it prints the script's full existing POD (NAME, SYNOPSIS, OPTIONS, DESCRIPTION, USAGE EXAMPLES, etc.) and exits 0. 3. Run: misc/cronjobs/runreport.pl Confirm it fails immediately with "ERROR: At least 1 reportID argument required (got 0)" and the usage text, before any database access, and exits non-zero. 4. Create a saved SQL report (Reports > Guided reports), note its ID, then run: misc/cronjobs/runreport.pl <id> misc/cronjobs/runreport.pl --format csv --csv-header <id> misc/cronjobs/runreport.pl --verbose <id> Confirm output matches this script's behavior before this patch (tab-separated by default, comma-separated with a header row when requested, and verbose logging of the SQL/argument count/result count). 5. Run misc/cronjobs/cart_to_shelf.pl --help and --hours 24 (bug 43546) and confirm both are unaffected. 6. Confirm koha-qa.pl passes for the changed files. Co-Authored-By: Claude Sonnet 5 <[email protected]> -- You are receiving this mail because: 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/
