Patchwork [2,of,3] flags: allow specifying --boolean-flag=(true|false) on the command line (BC)

login
register
mail settings
Submitter Augie Fackler
Date Aug. 19, 2016, 1:27 p.m.
Message ID <B0E35965-869F-4AB3-A561-5576A5FC6CBF@durin42.com>
Download mbox | patch
Permalink /patch/16360/
State Changes Requested
Headers show

Comments

Augie Fackler - Aug. 19, 2016, 1:27 p.m.
On Aug 19, 2016, at 09:02, Augie Fackler <raf@durin42.com> wrote:
> On Aug 18, 2016, at 15:52, Kyle Lippincott <spectral@pewpew.net> wrote:
>> On Thu, Aug 18, 2016 at 9:13 AM, Augie Fackler <raf@durin42.com> wrote:
>> # HG changeset patch
>> # User Augie Fackler <augie@google.com>
>> # Date 1471534453 14400
>> #      Thu Aug 18 11:34:13 2016 -0400
>> # Node ID 9ec3aad0bf74ad1c25e87bcd0f536896d1c355ca
>> # Parent  8ed7fdc716ffc95a4062875eafc2739697122fbc
>> flags: allow specifying --boolean-flag=(true|false) on the command line (BC)
>> 
>> Do we want to describe this (in this description) as supporting all of the things parseable by parsebool?  Not sure how much it matters to be pedantically correct in the descriptions.
> 
> Probably should be in the commit message, yeah.
> 
>> Is there documentation that needs to be updated to mention this is now possible?  (might be already done in another change in this series, but I didn't see it)
> 
> I'm honestly not sure where to tuck this doc-wise, given that it matters for all boolean flags everywhere. Sigh. I'm very open to ideas...

Here's one idea. I don't know how clear it is though. Left side of the diff is what we have today, right side of the diff is what I'm proposing. I don't love it, but maybe it helps?

Kind of ugly though. Sigh.

augie% diff -u <(hg help update) <(./hg help update)
timeless - Aug. 25, 2016, 11:43 p.m.
>>> Is there documentation that needs to be updated to mention this is now possible?  (might be already done in another change in this series, but I didn't see it)
>>
>> I'm honestly not sure where to tuck this doc-wise, given that it matters for all boolean flags everywhere. Sigh. I'm very open to ideas...
>
> Here's one idea. I don't know how clear it is though. Left side of the diff is what we have today, right side of the diff is what I'm proposing. I don't love it, but maybe it helps?
>
> Kind of ugly though. Sigh.
> + -C --clean[=(true|false)] discard uncommitted changes (no backup)
> + -c --check[=(true|false)] require clean working directory
> +    --mq[=(true|false)]    operate on patch repository

I'm opposed to this style of docs. We should add some punctuation to
each option that will support --no-, tentatively, I'd suggest one of
`^`, ''~', or '!'.
And after the table include:

Options marked with '^' can be turned off using --no-[optionname] as
in --no-check.

Patch

--- /dev/fd/11	2016-08-19 09:26:16.000000000 -0400
+++ /dev/fd/12	2016-08-19 09:26:16.000000000 -0400
@@ -31,11 +31,11 @@ 

 options:

- -C --clean      discard uncommitted changes (no backup)
- -c --check      require clean working directory
- -d --date DATE  tipmost revision matching date
- -r --rev REV    revision
- -t --tool VALUE specify merge tool
-    --mq         operate on patch repository
+ -C --clean[=(true|false)] discard uncommitted changes (no backup)
+ -c --check[=(true|false)] require clean working directory
+ -d --date DATE            tipmost revision matching date
+ -r --rev REV              revision
+ -t --tool VALUE           specify merge tool
+    --mq[=(true|false)]    operate on patch repository

 (some details hidden, use --verbose to show complete help)