https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=43552

--- Comment #1 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 206184
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=206184&action=edit
Bug 43552: Convert gather_print_notices.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. The mandatory output_directory is a positional argument, not a
named option, so it uses the args => { min => 1 } support added on
bug 43546's follow-up, replacing the hand-rolled "no reportID" style
check with a consistent one.

Two checks stay as post-parse code, same reasoning as the sibling
bugs in this set:
- output_directory must exist and be writeable: a filesystem-state
  check, not a CLI-shape one.
- --csv/--ods must be combined with exactly one --letter_code: not a
  simple mutual-exclusivity pair (Koha::Script's exclusive support
  from bug 43557 doesn't fit), and not a single-option shape check
  either.

--send's existing Getopt::Long negatable flag (send!) carries over
directly; describe_options renders it as --[no-]send in --help for
free.

One minor, expected loss consistent with the other scripts converted
so far: -h no longer means --help (describe_options' auto-added help
is always help|?, no short letter); updated the SYNOPSIS/OPTIONS POD
to stop advertising it.

Test plan:
1. gather_print_notices.pl --help / --man
2. gather_print_notices.pl (no output_directory)
   Rejected: at least 1 output_directory argument required.
3. gather_print_notices.pl /no/such/dir
   Rejected: must specify a valid and writeable directory.
4. gather_print_notices.pl --csv /tmp/some-writeable-dir
   Rejected: --csv needs exactly one --letter_code.
5. gather_print_notices.pl /tmp/some-writeable-dir
   Runs to completion (default html format).
6. koha-qa.pl passes.

-- 
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/

Reply via email to