Skip to content

feat(cli): break help into topics, add help-<topic> commands - #121

Merged
oguyon merged 2 commits into
framework-devfrom
feat/cli-help-topics
Mar 21, 2026
Merged

feat(cli): break help into topics, add help-<topic> commands#121
oguyon merged 2 commits into
framework-devfrom
feat/cli-help-topics

Conversation

@oguyon

@oguyon oguyon commented Mar 21, 2026

Copy link
Copy Markdown
Member

Summary

The existing help / milk-cli-help output 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)

Command Description
help-cmdopts Command-line flags (-h, -s, -n, -f, …)
help-syntax Syntax rules, tab completion, piping
help-commands Built-in CLI commands (?, cmd?, m?, …)
help-variables Variables, string ops, arrays, arithmetic, FPS access
help-flowcontrol if/elif/else, while, for, case, function
help-scripting Script files, built-ins, I/O, traps, shell options
help-milk milk-specific (streams, FPS, waitfor_*, on_update)

Shell executable

$ milk-cli-help           # compact topic index
$ milk-cli-help syntax    # detailed syntax help
$ milk-cli-help badtopic  # error message + exit 1

Backwards compatibility

  • help and ? still work — they now show the compact topic index
  • help <topic> dispatches to the topic (new overload)
  • milk-cli-help with no args still shows help (now compact index)

Files changed

  • CLIcore_help.c — topic split, index, dispatcher, updated help()
  • CLIcore_help.h — declarations for new functions
  • CLIcore.c — 7 new RegisterCLIcommand entries + file-scope wrappers
  • milk-cli-help.c — topic dispatch via argv[1]

Prompt Summary

User requested that the monolithic milk-cli-help and help command output be broken down into topics, accessible via help-<topic> CLI commands and milk-cli-help <topic> from the shell.

AI Authorship

  • Model used: Gemini (Google DeepMind) — exact version unknown
  • User edits: None — all changes made by the AI agent

oguyon added 2 commits March 21, 2026 00:27
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
oguyon merged commit 983d6d9 into framework-dev Mar 21, 2026
2 of 3 checks passed
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."
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