From 41b7791b0f05da4abed44a12f5c27551ca0de048 Mon Sep 17 00:00:00 2001 From: Justin Blake Date: Tue, 27 Oct 2026 06:26:26 -0400 Subject: [PATCH 1/2] Explain the Cli.Parser.Command fields in docstring When writing a CLI using the Cli modules I have been finding these fields confusing and always have to look up what they are used for. --- src/Cli/Parser.gren | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/Cli/Parser.gren b/src/Cli/Parser.gren index e32c4db..658946b 100644 --- a/src/Cli/Parser.gren +++ b/src/Cli/Parser.gren @@ -285,6 +285,13 @@ prefixHelpText appName prefixName (GroupParser { knownCommands }) = {-| Definition of a command. + +* `word` is the name of the command, like `make` in `gren make`. +* `arguments` and `flags` parse the command's inputs, which will be passed to `builder`. +* `commonDescription`, if set, will include the command along with this description in the list of "commonly used" commands shown in the program's usage help text. +* `summary` is the short description of the command, shown at the top of the command's help text. +* `example` is the longer description and/or example(s) of using the command. It comes after `summary` in the command help text. +* `builder` combines the parsed arguments and flags into a `result` -} type alias Command args flags result = { word : String From 55e919c83e49f60cff59c23e6a006c4335d875ad Mon Sep 17 00:00:00 2001 From: Justin Blake Date: Tue, 27 Oct 2026 06:30:52 -0400 Subject: [PATCH 2/2] Add a doc:preview devbox script. I like to run this before shipping doc changes but I always have to look up how to do it. --- devbox.json | 1 + 1 file changed, 1 insertion(+) diff --git a/devbox.json b/devbox.json index 46eb1ad..a19fc67 100644 --- a/devbox.json +++ b/devbox.json @@ -12,6 +12,7 @@ ], "format": "prettier -w \"**/*.{js,mjs}\"", "format:check": "prettier -c \"**/*.{js,mjs}\"", + "doc:preview": "npx -y --package gren-packages gren-doc-preview", "test": [ "devbox run test:unit", "devbox run test:integration"