Skip to content

doc: add guide to contribute a new command line switch - #728

Merged
xdelaruelle merged 1 commit into
envmodules:mainfrom
xdelaruelle:devel-guide-cli-switch
Oct 31, 2026
Merged

xdelaruelle merged 1 commit into
envmodules:mainfrom
xdelaruelle:devel-guide-cli-switch

Conversation

@xdelaruelle

Copy link
Copy Markdown
Collaborator

Developer howtos exist to add a sub-command or a configuration option but none describes the files to touch when introducing a command line switch. This involves steps that are easy to miss: a switch is parsed either in the main program section of tcl/main.tcl.in or in parseModuleCommandArgs depending on its kind, a sub-command switch must also be registered in the main parser to be accepted before the sub-command name, and completion scripts, Nagelfar syntax database and testsuite files each have dedicated places for it.

This adds the add-new-command-line-switch developer guide, modeled on the configuration option one. It covers top-level switches, sub-command switches and the case of an existing switch accepted on an additional sub-command (like the recent --terse support on whatis and search), with example commits for each step. The guide is referenced from the contributing guide, the testsuite guide and the AI assistant instructions, and the words it introduces are added to the hunspell dictionary.

Developer howtos exist to add a sub-command or a configuration option but
none describes the files to touch when introducing a command line switch,
although it involves specific steps that are easy to miss: switch may be
parsed either in the main program section or in parseModuleCommandArgs
depending on its kind, a sub-command switch must also be registered in the
main parser to be accepted before the sub-command name, completion
scripts, Nagelfar syntax database and testsuite files have dedicated
places for it.

Add the add-new-command-line-switch guide covering top-level switches,
sub-command switches and the case of an existing switch accepted on an
additional sub-command, with example commits for each step. Reference it
from the contributing guide, the testsuite guide and the AI assistant
instructions.

Assisted-by: Claude:claude-fable-5-1
Signed-off-by: Xavier Delaruelle <xavier.delaruelle@cea.fr>
@xdelaruelle
xdelaruelle merged commit b24d3bb into envmodules:main Oct 31, 2026
22 checks passed
@xdelaruelle
xdelaruelle deleted the devel-guide-cli-switch branch October 31, 2026 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant