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

--- Comment #12 from Martin Renvoize (ashimema) 
<[email protected]> ---
Created attachment 210821
  -->
https://bugs.koha-community.org/bugzilla3/attachment.cgi?id=210821&action=edit
Bug 43552: (QA follow-up) Accept -nosend and -no-send for negatable options in
the legacy shim

Koha::Script->describe_options rewrites the single-dash long options that plain
Getopt::Long accepted (e.g. -days) as the standard --days, with a deprecation
warning. It did not know the negated form of a negatable option such as
send!, so -nosend (and -no-send) were no longer accepted, and failed with
"Unknown option: n" as a bundle of one-character flags. This broke existing
command lines such as 'gather_print_notices.pl /dir -nosend'.

A negatable long option is now also accepted as -no<name> and -no-<name>,
rewritten as --no-<name>, with the same deprecation warning. Only those exact
spellings are accepted: a prefix does not resolve to a negated form, and the
negated form of an option that is not negatable is still an error.

To test:
1. Apply the patches
2. Run
   $ ktd --shell
   k$ prove t/Koha/Script.t
=> SUCCESS: Tests pass!
3. Without the Koha/Script.pm change, the new tests fail
4. misc/cronjobs/gather_print_notices.pl /tmp -nosend
=> Runs, with a warning that -nosend is deprecated, use --no-send
5. misc/cronjobs/gather_print_notices.pl /tmp --nosend
=> Runs, without a warning
6. Sign off :-D

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

Reply via email to