On Sun, 08 Apr 2007, kou@tigris.org wrote:
> Author: kou
> Date: Sun Apr 8 22:05:02 2007
> New Revision: 24502
>
> Log:
> Add --from-domain option.
>
> * tools/hook-scripts/commit-email.rb:
> - Add --from-domain option.
> - Improve error handling.
> (OptionParser::CanNotCoexistOption): New exception.
>
>
> Modified:
> trunk/tools/hook-scripts/commit-email.rb
>
> Modified: trunk/tools/hook-scripts/commit-email.rb
> URL: http://svn.collab.net/viewvc/svn/trunk/tools/hook-scripts/commit-email.rb?pathrev=24502&r1=24501&r2=24502
> ==============================================================================
> --- trunk/tools/hook-scripts/commit-email.rb (original)
> +++ trunk/tools/hook-scripts/commit-email.rb Sun Apr 8 22:05:02 2007
> @@ -7,11 +7,18 @@
>
> SENDMAIL = "/usr/sbin/sendmail"
>
> +class OptionParser
> + class CanNotCoexistOption < ParseError
CannotCoexistOption
> + const_set(:Reason, 'can not coexist option'.freeze)
"Cannot coexist option"
> + end
> +end
> +
> def parse_args(args)
> options = OpenStruct.new
> options.to = []
> options.error_to = []
> options.from = nil
> + options.from_domain = nil
> options.add_diff = true
> options.repository_uri = nil
> options.rss_path = nil
> @@ -40,9 +47,22 @@
>
> opts.on("-fFROM", "--from=FROM",
> "Use FROM as from address") do |from|
> + if options.from_domain
> + raise OptionParser::CanNotCoexistOption,
> + "can't coexist with --from-domain"
...
We used "cannot" above. Either avoid a contraction here, or use a
contraction in both spots.
- application/pgp-signature attachment: stored
Received on Mon Apr 9 18:32:59 2007