[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?
From: |
Thomas Keller |
Subject: |
Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking? |
Date: |
Sun, 04 Jan 2009 03:27:54 +0100 |
User-agent: |
Thunderbird 2.0.0.19 (Macintosh/20081209) |
Timothy Brownawell schrieb:
> Many commands check for eg the right number of arguments like so:
>
> if (args.size() != 3)
> throw usage(execid);
>
> where others do
>
> N(args.size() == 0,
> F("no arguments needed"));
>
>
> This ought to be made consistent, does anyone object to using the
> 'throw usage();' version everywhere?
The only thing which comes into my mind is the automation interface here
- we don't want to provide the full-blown (localized) help output to the
interface here, but rather a hint that the call wasn't syntactically
correct.
This reminds me on something I have on my wishlist - while syntactic
option errors (ie. an option does not exist or is invalid for a given
command) are handled before a command is executed, the argument checking
happens in the command itself. This is usually not a problem, unless we
really want to distinguish between syntax errors and other runtime
errors f.e. in automate...
Thomas.
--
GPG-Key 0x160D1092 | address@hidden | http://thomaskeller.biz
Please note that according to the EU law on data retention, information
on every electronic information exchange might be retained for a period
of six months or longer: http://www.vorratsdatenspeicherung.de/?lang=en
signature.asc
Description: OpenPGP digital signature
- [Monotone-devel] "throw usage();" or "N();" for argument checking?, Timothy Brownawell, 2009/01/03
- Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?,
Thomas Keller <=
- Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?, LeJacq, Jean Pierre, 2009/01/04
- Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?, Timothy Brownawell, 2009/01/04
- Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?, Markus Wanner, 2009/01/04
- Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?, Timothy Brownawell, 2009/01/04
- Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?, Zack Weinberg, 2009/01/04
- Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?, Thomas Keller, 2009/01/04
- Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?, Timothy Brownawell, 2009/01/12
- Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?, LeJacq, Jean Pierre, 2009/01/04
- Re: [Monotone-devel] "throw usage(); " or "N(); " for argument checking?, Markus Wanner, 2009/01/04