Fossil User Forum

Issues with fossil commands and help text
Login

Issues with fossil commands and help text

Issues with fossil commands and help text

(1) By Doug (doug9forester) on 2023-08-12 00:43:46 [source]

I have been using fossil for a year or more and love it. It's easy to set up to control any set of files I wish to manage. However, almost every time I run a command other than checkin, I have to look at the help for that command because I can never be sure where the options go. So I investigated the fossil help to understand the scope of the problem.

For most of the 56 commands, the ?OPTIONS? are before the arguments. But for ten of them, the ?OPTIONS? are after the arguments. And for 3 commands and 10 subcommands, the usage does not display "?OPTIONS?" so you have no clue where it goes.

I propose that fossil be changed to allow the ?OPTIONS? to always be before any other arguments to a command, and same thing for subcommands. I realize that there is legacy code out there probably depending on the order of the options. But that's a simple problem to handle: for those commands that have the options backwards, allow either leading or trailing options (I hate it, too).

So there's four things to do: the first thing is to edit the help so that the usage shows where the ?OPTIONS? are expected for those commands where it's missing. The second is a code change to handle the options in their normal place (in addition to their abnormal place for now). Thirdly, edit the help to show the ?OPTIONS? before all the arguments. And fourth - somewhere down the pike - remove the ability to have the ?OPTIONS? after the arguments for those ten commands.

I'm volunteering to do all the work and generate patches if someone will lead me by the hand to get me started.

Here is the Usage file I generated using fossil version 2.22. My comments follow the usage line:

Usage: fossil add ?OPTIONS? FILE1 ?FILE2 ...?
Usage: fossil changes|status ?OPTIONS? ?PATHS ...?
Usage: fossil diff|gdiff ?OPTIONS? ?FILE1? ?FILE2 ...?
Usage: fossil merge ?OPTIONS? ?VERSION?
Usage: fossil repack ?REPOSITORY?
Usage: fossil tag SUBCOMMAND ...
Usage: fossil addremove ?OPTIONS?
Usage: fossil chat [SUBCOMMAND] [--remote URL] [ARGS...]
	missing ?OPTIONS? in usage for chat send [ARGUMENTS] - do the options come before the arguments or after them?
Usage: fossil extras ?OPTIONS? ?PATH1 ...?
Usage: fossil merge ?OPTIONS? ?VERSION?
Usage: fossil revert ?OPTIONS? ?FILE ...?
Usage: fossil timeline ?WHEN? ?CHECKIN|DATETIME? ?OPTIONS?
	?OPTIONS? is after the action selections instead of before them
Usage: fossil all SUBCOMMAND ...
Usage: fossil merge ?OPTIONS? ?VERSION?
Usage: fossil finfo ?OPTIONS? FILENAME
Usage: fossil mv|rename OLDNAME NEWNAME
	missing ?OPTIONS? in usage
Usage: fossil rm|delete|forget FILE1 ?FILE2 ...?
	missing ?OPTIONS? in usage
Usage: fossil server ?OPTIONS? ?REPOSITORY?
Usage: fossil amend HASH OPTION ?OPTION ...?
	Keyword "OPTION" is in usage but not the text ???
	?OPTIONS? is after the action selections instead of before them
Usage: fossil clean ?OPTIONS? ?PATH ...?
Usage: fossil diff|gdiff ?OPTIONS? ?FILE1? ?FILE2 ...?
Usage: fossil open REPOSITORY ?VERSION? ?OPTIONS?
	?OPTIONS? is after the action selections instead of before them
Usage: fossil settings ?SETTING? ?VALUE? ?OPTIONS?
	?OPTIONS? is after the action selections instead of before them
Usage: fossil undo ?OPTIONS? ?FILENAME...?
Usage: fossil annotate|blame|praise ?OPTIONS? FILENAME
Usage: fossil clone ?OPTIONS? URI ?FILENAME?
Usage: fossil grep [OPTIONS] PATTERN FILENAME ...
	[OPTIONS] should be spelled ?OPTIONS? in usage
Usage: fossil patch SUBCOMMAND ?ARGS ..?
	missing ?OPTIONS? in usage for patch create
	missing ?OPTIONS? in usage for patch apply
	missing ?OPTIONS? in usage for patch diff/gdiff
	missing ?OPTIONS? in usage for patch push
	missing ?OPTIONS? in usage for patch view	
Usage: fossil sql ?OPTIONS?
	?OPTIONS? is after the action selections instead of before them
Usage: fossil unversioned SUBCOMMAND ARGS...
	missing ?OPTIONS? in usage for unversioned list/ls
	missing ?OPTIONS? in usage for unversioned revert
	missing ?OPTIONS? in usage for unversioned remove/rm/delete
	missing ?OPTIONS? in usage for unversioned sync
	Options (--mtime, -R) are listed in the help text but it's not clear where to put them if you use them
Usage: fossil bisect SUBCOMMAND ...
	[OPTIONS] should be spelled ?OPTIONS? in help text: fossil bisect run [OPTIONS] COMMAND
Usage: fossil commit ?OPTIONS? ?FILE...?
Usage: fossil help [OPTIONS] [TOPIC]
	[OPTIONS] should be spelled ?OPTIONS? in usage
Usage: fossil pull ?URL? ?options?
	?options? should be spelled ?OPTIONS? in usage
Usage: fossil configuration METHOD ... ?OPTIONS?
	The only option is -R/--repository. Instead make the usage this:
		fossil configuration METHOD ... [-R | --repository REPOSITORY]
	Also, nothing in the help text about what happens if you don't specify a repository
Usage: fossil update ?OPTIONS? ?VERSION? ?FILES...?
Usage: fossil annotate|blame|praise ?OPTIONS? FILENAME
Usage: fossil dbstat OPTIONS
	OPTIONS should be spelled ?OPTIONS? in the usage
Usage: fossil info ?VERSION | REPOSITORY_FILENAME? ?OPTIONS?
	?OPTIONS? is after the action selections instead of before them
Usage: fossil push ?URL? ?options?
	?options? should be spelled ?OPTIONS? in usage
	?OPTIONS? is after the action selections instead of before them
Usage: fossil stash SUBCOMMAND ARGS...
Usage: fossil version ?-v|--verbose?
Usage: fossil branch SUBCOMMAND ... ?OPTIONS?
	The only option is -R/--repository. Instead make the usage this:
		fossil branch SUBCOMMAND ... [-R | --repository REPOSITORY]
Usage: fossil rm|delete|forget FILE1 ?FILE2 ...?
	missing ?OPTIONS? in usage
Usage: fossil new ?OPTIONS? FILENAME
Usage: fossil rebuild ?REPOSITORY? ?OPTIONS?
	It's not what happens if ?REPOSITORY? is missing
	?OPTIONS? should be before ?REPOSITORY? 
Usage: fossil changes|status ?OPTIONS? ?PATHS ...?
Usage: fossil xdiff [options] FILE1 FILE2
	[options] should be spelled ?OPTIONS? in usage
Usage: fossil cat FILENAME ... ?OPTIONS?
	?OPTIONS? is after the action selections instead of before them
Usage: fossil describe ?VERSION? ?OPTIONS?
	?OPTIONS? is after the action selections instead of before them
Usage: fossil ls ?OPTIONS? ?PATHS ...?
Usage: fossil remote ?SUBCOMMAND ...?
Usage: fossil sync ?URL? ?options?
	?options? should be spelled ?OPTIONS? in usage
	?OPTIONS? is after the action selections instead of before them

(2) By Stephan Beal (stephan) on 2023-08-12 01:37:08 in reply to 1 [link] [source]

For most of the 56 commands, the ?OPTIONS? are before the arguments. But for ten of them, the ?OPTIONS? are after the arguments.

The order is irrelevant for fossil. It consumes all flags before it starts processing other arguments.