Open jasonkuhrt opened 1 year ago
iteration two:
❯ px @molt/command run examples:intro
> @molt/command@0.6.0 examples:intro /Users/jasonkuhrt/projects/jasonkuhrt/molt/packages/@molt/command
> ts-node examples/intro.ts
┃ Oops! I could not execute command as you requested. There were some problems
┃ with your input. See below for details.
INPUT ERRORS (x2)
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
◌ MISSING INPUT (x2)
1 ◌ 2 ◌
┆ ┆
$ ts-node intro.ts --filePath xxxx --to xxxx
1 ◌ MISSING INPUT
--------------------------------------------------------------------------------
You must give input for the "filePath" parameter. Here is its documentation:
Name Type/Description Default Environment (1)
filePath string REQUIRED ✓
Path to the file to convert.
2 ◌ MISSING INPUT
--------------------------------------------------------------------------------
You must give input for the "to" parameter. Here is its documentation:
Name Type/Description Default Environment (1)
to json | yaml | toml REQUIRED ✓
Format to convert to.
NOTES
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
(1) Parameters can be passed arguments via environment variables. Command line
arguments take precedence. Environment variable names are snake cased
versions of the parameter name (or its aliases), case insensitive. They must
be prefixed with CLI_PARAMETER_ or CLI_PARAM_ (case insensitive). Examples:
→ CLI_PARAMETER_MOVE="..."
→ CLI_PARAMETER_VERBOSE="..."
→ CLI_PARAMETER_TO="...".
Perceived Problem
This is the feedback a user gets when they do not supply a required flag:
Problems:
The entire help is shown, which could be huge, but only some inputs were missing. So showing help for inputs that were given for example is probably useless.
There is no clear visualization between the input the user gave, the error, and the docs. That means it requires the reader (user) to piece this together.
Ideas / Proposed Solution(s)
Here is a monochrome sketch of better output: