Fossil Forum

RFC: More --dry-run vs --dryrun inconsistency
Login

RFC: More --dry-run vs --dryrun inconsistency

RFC: More --dry-run vs --dryrun inconsistency

(1.1) By Stephan Beal (stephan) on 2022-07-05 06:14:47 edited from 1.0 [source]

i thought this was ironed out long ago, but apparently not: we still have a good deal of inconsistency regarding --dry-run vs --dryrun:

[stephan@nuc:~/fossil/fossil/src]$ grep -l -w dryrun *.c
db.c
file.c
forum.c
info.c
patch.c
tag.c
unversioned.c
[stephan@nuc:~/fossil/fossil/src]$ grep -l -w dry-run *.c
add.c
allrepo.c
branch.c
checkin.c
db.c
file.c
fileedit.c
hook.c
info.c
merge.c
purge.c
undo.c
update.c

My recollection (perhaps wrong) is that the consensus was that --dry-run was the preferred flag. If we can agree to that (or the opposite) i'll go swap out the inconsistent flags with the one we agree is correct.

The main implication of replacing a flag is that the old flag will trigger an "unhandled argument" error, which is a good thing. This means that if anyone is actually using --dry-run/--dryrun in a script1, their scripts would break instead of suddenly running in non-dry-run mode.

Are there any objections to my replacing --dryrun with --dry-run in all command flags?

Edit: yes, we "could" support both flags for all commands, but that gains us nothing.


  1. ^ though it's difficult to conceive of a use for

(2) By anonymous on 2022-07-05 06:30:18 in reply to 1.1 [link] [source]

I suggest keeping the unwanted spelling (--dryrun), undocumented, in the commands it's currently used.

(3) By Stephan Beal (stephan) on 2022-07-05 06:44:53 in reply to 2 [link] [source]

I suggest keeping the unwanted spelling (--dryrun), undocumented, in the commands it's currently used.

Though i am not outright against that, it doesn't gain us anything except for more user-side confusion. Someone will rightfully ask, "if both options work in some commands, why shouldn't they work in all commands?" People who are used to unversioned --dryrun will want to use add --dryrun and wonder why it doesn't work. Rather than support both options in all commands, it would be less painful to consolidate all commands to use a single variant of the flag. Yes, it would be slightly annoying for those people who currently use --dryrun in some commands, but long term it will be less annoying for them because --dry-run would be consistent across all commands and they wouldn't have to look at the help text to figure out which flag to use.

Looking at a few other random apps, --dry-run seems to be the conventional name for the flag.

(4) By Daniel Dumitriu (danield) on 2022-07-05 07:04:39 in reply to 3 [link] [source]

I also for just one flag to rule them all.

(5) By Stephan Beal (stephan) on 2022-07-05 07:46:48 in reply to 1.1 [link] [source]

Are there any objections to my replacing --dryrun with --dry-run in all command flags?

A proposed patch for this is at src:/timeline?r=dryrun-dry-run.

(6) By mark on 2022-07-05 07:50:12 in reply to 5 [link] [source]

I'm in complete agreement with this!

(7) By Stephan Beal (stephan) on 2022-07-21 21:28:04 in reply to 1.1 [link] [source]

Are there any objections to my replacing --dryrun with --dry-run in all command flags?

"Last call" - i will merge this in the next day or two unless there are strong objections to the contrary. To re-stress one point:

Edit: yes, we "could" support both flags for all commands, but that gains us nothing.