feat(cli): break help into topics, add help-<topic> commands - #121
Merged
Conversation
The monolithic print_milk_cli_help() / milk-cli-help output was too
long. This commit splits help into 7 short, focused topics:
cmdopts - command-line flags (-h, -s, -n, -f, …)
syntax - syntax rules, tab completion, piping
commands - built-in CLI commands (?, cmd?, m?, …)
variables - variables, string ops, arrays, arithmetic, FPS access
flowcontrol - if/elif/else, while, for, case, function
scripting - script files, built-ins, I/O, traps, shell options
milk - milk-specific (streams, FPS, waitfor_*, on_update)
Changes:
CLIcore_help.c:
- Replaced the monolithic print_milk_cli_help() body with a compact
topic index listing all 7 topics and the milk-cli-help <topic>
usage hint.
- Added per-topic functions: help_topic_cmdopts(), help_topic_syntax(),
help_topic_commands(), help_topic_variables(),
help_topic_flowcontrol(), help_topic_scripting(), help_topic_milk().
- Added help_topic_dispatch(const char *topic) dispatcher.
- Updated help() to optionally accept a topic argument token and
dispatch, or fall back to the compact index.
CLIcore_help.h:
- Declared all help_topic_*() functions and help_topic_dispatch().
CLIcore.c:
- Added 7 static thin-wrapper errno_t functions at file scope.
- Registered 7 new CLI commands: help-cmdopts, help-syntax,
help-commands, help-variables, help-flowcontrol, help-scripting,
help-milk.
milk-cli-help.c:
- Added argv[1] topic dispatch: milk-cli-help <topic> calls
help_topic_dispatch(); unknown topics print an error and exit 1.
- Default (no args) prints the compact index."
oguyon
added a commit
that referenced
this pull request
May 21, 2026
The monolithic print_milk_cli_help() / milk-cli-help output was too
long. This commit splits help into 7 short, focused topics:
cmdopts - command-line flags (-h, -s, -n, -f, …)
syntax - syntax rules, tab completion, piping
commands - built-in CLI commands (?, cmd?, m?, …)
variables - variables, string ops, arrays, arithmetic, FPS access
flowcontrol - if/elif/else, while, for, case, function
scripting - script files, built-ins, I/O, traps, shell options
milk - milk-specific (streams, FPS, waitfor_*, on_update)
Changes:
CLIcore_help.c:
- Replaced the monolithic print_milk_cli_help() body with a compact
topic index listing all 7 topics and the milk-cli-help <topic>
usage hint.
- Added per-topic functions: help_topic_cmdopts(), help_topic_syntax(),
help_topic_commands(), help_topic_variables(),
help_topic_flowcontrol(), help_topic_scripting(), help_topic_milk().
- Added help_topic_dispatch(const char *topic) dispatcher.
- Updated help() to optionally accept a topic argument token and
dispatch, or fall back to the compact index.
CLIcore_help.h:
- Declared all help_topic_*() functions and help_topic_dispatch().
CLIcore.c:
- Added 7 static thin-wrapper errno_t functions at file scope.
- Registered 7 new CLI commands: help-cmdopts, help-syntax,
help-commands, help-variables, help-flowcontrol, help-scripting,
help-milk.
milk-cli-help.c:
- Added argv[1] topic dispatch: milk-cli-help <topic> calls
help_topic_dispatch(); unknown topics print an error and exit 1.
- Default (no args) prints the compact index."
oguyon
added a commit
that referenced
this pull request
May 21, 2026
The monolithic print_milk_cli_help() / milk-cli-help output was too
long. This commit splits help into 7 short, focused topics:
cmdopts - command-line flags (-h, -s, -n, -f, …)
syntax - syntax rules, tab completion, piping
commands - built-in CLI commands (?, cmd?, m?, …)
variables - variables, string ops, arrays, arithmetic, FPS access
flowcontrol - if/elif/else, while, for, case, function
scripting - script files, built-ins, I/O, traps, shell options
milk - milk-specific (streams, FPS, waitfor_*, on_update)
Changes:
CLIcore_help.c:
- Replaced the monolithic print_milk_cli_help() body with a compact
topic index listing all 7 topics and the milk-cli-help <topic>
usage hint.
- Added per-topic functions: help_topic_cmdopts(), help_topic_syntax(),
help_topic_commands(), help_topic_variables(),
help_topic_flowcontrol(), help_topic_scripting(), help_topic_milk().
- Added help_topic_dispatch(const char *topic) dispatcher.
- Updated help() to optionally accept a topic argument token and
dispatch, or fall back to the compact index.
CLIcore_help.h:
- Declared all help_topic_*() functions and help_topic_dispatch().
CLIcore.c:
- Added 7 static thin-wrapper errno_t functions at file scope.
- Registered 7 new CLI commands: help-cmdopts, help-syntax,
help-commands, help-variables, help-flowcontrol, help-scripting,
help-milk.
milk-cli-help.c:
- Added argv[1] topic dispatch: milk-cli-help <topic> calls
help_topic_dispatch(); unknown topics print an error and exit 1.
- Default (no args) prints the compact index."
oguyon
added a commit
that referenced
this pull request
May 22, 2026
The monolithic print_milk_cli_help() / milk-cli-help output was too
long. This commit splits help into 7 short, focused topics:
cmdopts - command-line flags (-h, -s, -n, -f, …)
syntax - syntax rules, tab completion, piping
commands - built-in CLI commands (?, cmd?, m?, …)
variables - variables, string ops, arrays, arithmetic, FPS access
flowcontrol - if/elif/else, while, for, case, function
scripting - script files, built-ins, I/O, traps, shell options
milk - milk-specific (streams, FPS, waitfor_*, on_update)
Changes:
CLIcore_help.c:
- Replaced the monolithic print_milk_cli_help() body with a compact
topic index listing all 7 topics and the milk-cli-help <topic>
usage hint.
- Added per-topic functions: help_topic_cmdopts(), help_topic_syntax(),
help_topic_commands(), help_topic_variables(),
help_topic_flowcontrol(), help_topic_scripting(), help_topic_milk().
- Added help_topic_dispatch(const char *topic) dispatcher.
- Updated help() to optionally accept a topic argument token and
dispatch, or fall back to the compact index.
CLIcore_help.h:
- Declared all help_topic_*() functions and help_topic_dispatch().
CLIcore.c:
- Added 7 static thin-wrapper errno_t functions at file scope.
- Registered 7 new CLI commands: help-cmdopts, help-syntax,
help-commands, help-variables, help-flowcontrol, help-scripting,
help-milk.
milk-cli-help.c:
- Added argv[1] topic dispatch: milk-cli-help <topic> calls
help_topic_dispatch(); unknown topics print an error and exit 1.
- Default (no args) prints the compact index."
DasVinch
pushed a commit
that referenced
this pull request
May 29, 2026
The monolithic print_milk_cli_help() / milk-cli-help output was too
long. This commit splits help into 7 short, focused topics:
cmdopts - command-line flags (-h, -s, -n, -f, …)
syntax - syntax rules, tab completion, piping
commands - built-in CLI commands (?, cmd?, m?, …)
variables - variables, string ops, arrays, arithmetic, FPS access
flowcontrol - if/elif/else, while, for, case, function
scripting - script files, built-ins, I/O, traps, shell options
milk - milk-specific (streams, FPS, waitfor_*, on_update)
Changes:
CLIcore_help.c:
- Replaced the monolithic print_milk_cli_help() body with a compact
topic index listing all 7 topics and the milk-cli-help <topic>
usage hint.
- Added per-topic functions: help_topic_cmdopts(), help_topic_syntax(),
help_topic_commands(), help_topic_variables(),
help_topic_flowcontrol(), help_topic_scripting(), help_topic_milk().
- Added help_topic_dispatch(const char *topic) dispatcher.
- Updated help() to optionally accept a topic argument token and
dispatch, or fall back to the compact index.
CLIcore_help.h:
- Declared all help_topic_*() functions and help_topic_dispatch().
CLIcore.c:
- Added 7 static thin-wrapper errno_t functions at file scope.
- Registered 7 new CLI commands: help-cmdopts, help-syntax,
help-commands, help-variables, help-flowcontrol, help-scripting,
help-milk.
milk-cli-help.c:
- Added argv[1] topic dispatch: milk-cli-help <topic> calls
help_topic_dispatch(); unknown topics print an error and exit 1.
- Default (no args) prints the compact index."
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
The existing
help/milk-cli-helpoutput was one long monolithic wall of text — ~500+ lines printed all at once, making it unusable.This PR breaks help into 7 focused topics accessible as CLI commands and as
milk-cli-help <topic>shell invocations.What changed
New commands (interactive CLI)
help-cmdoptshelp-syntaxhelp-commandshelp-variableshelp-flowcontrolhelp-scriptinghelp-milkShell executable
Backwards compatibility
helpand?still work — they now show the compact topic indexhelp <topic>dispatches to the topic (new overload)milk-cli-helpwith no args still shows help (now compact index)Files changed
CLIcore_help.c— topic split, index, dispatcher, updatedhelp()CLIcore_help.h— declarations for new functionsCLIcore.c— 7 newRegisterCLIcommandentries + file-scope wrappersmilk-cli-help.c— topic dispatch viaargv[1]Prompt Summary
User requested that the monolithic
milk-cli-helpandhelpcommand output be broken down into topics, accessible viahelp-<topic>CLI commands andmilk-cli-help <topic>from the shell.AI Authorship