Timothy Brownawell <[email protected]> writes: > On 06/13/2010 07:18 AM, Stephen Leake wrote: >> In starting work on negatable options, I looked thru all of the current >> boolean options. These are all related, at least in the English meaning >> of their names: >> >> OPT(full, "full", bool, false, >> GOPT(quiet, "quiet", bool, false, >> GOPT(reallyquiet, "reallyquiet", bool, false, >> OPT(verbose, "verbose", bool, false, >> >> We could change them to a single verbosity integer, where 0 = normal,< >> 0 is progressively quieter,> 0 is progressively noisier: >> >> <default> = 0 >> quiet = -1 >> reallyquiet = -2 >> verbose = 1 >> full = 2 >> >> However, these options are used rarely, or not at all: >> >> "full" is used by: >> CMD_NO_WORKSPACE(version, "version", "", CMD_REF(informative), "", >> CMD(db_info, "info", "", CMD_REF(db), "", >> >> "verbose" is used by: >> CMD(complete, "complete", "", CMD_REF(informative), > > Probably --full could be replaced with --verbose, or they could be > made identical.
Right. >> "quiet" and "reallyquiet" are not used at all. Compiling with those >> options deleted from options_list.hh confirms that. > > Those are used. They're global options, and instead of directly > setting a variable they just call a function on the sanity object. Ah. Missed that. Reading the code more closely, that is what it says :). > ...hm, giving '--quiet' or '--reallyquiet' over remote_stdio has > persistent effects on the server. That's not good. Because they don't get reset by 'app.opts = original_opts' in automate_stdio_shared_body, I gather. --debug, --dump also affect global_sanity. --log, --timestamps affect ui; that seems equally bad. >> So we could keep 'full' and 'verbose' as booleans, and just live with >> the --no- forms. >> >> I think an integer verbosity is more flexible in the long run. Some >> other tools I've used allow incrementing the integer by repeating -v; >> that's a simple interface. But that should be done in another branch, >> separate from the negatable options work. > > That could be reasonable, replace all four with a global > "--verbosity=<-2,-1,0,1>". Probably this should be part of resettable > options, since --quiet and --reallyquiet need to be fixed anyway For the undesired affect on the server, you mean? > and can be made resettable along the way. Ok. If we remove names, we need a deprecate mechanism. Or maybe not; we could say "we're not at 1.0 yet". But we will after that. >> For now, any objections to deleting "quiet" and "reallyquiet" from nvm? > > They turn off tickers and P() messages, and --reallyquiet also turns > off W() messages. We probably want to keep them. Yes. I don't see an easy way to make W use an option in app.opts; we certainly don't want to change it to take an app argument. One fix is to have automate_shared_body save and restore the value of these global options (verbosity, debug, dump, log, and timestamps), as it does app.opts. But we need a cleaner way to do that, so if more global options are added, they also get restored. -- -- Stephe _______________________________________________ Monotone-devel mailing list [email protected] http://lists.nongnu.org/mailman/listinfo/monotone-devel
