-
Notifications
You must be signed in to change notification settings - Fork 3
Closed
Description
Cobra Commands support an Example field, to display examples of the command when the help of the command is displayed.
Let's add meaningful examples to the different commands:
- init
- workspace list
- workspace remove
Test the examples using unit tests:
Consider the Example string:
# List all workspaces (human-readable format):
kortex-cli workspace list
# List all workspaces using short alias (human-readable format):
kortex-cli list
# List workspaces in JSON format
kortex-cli workspace list --output json
- extract from this string the commands (ignore empty lines and lines starting with
#, consider lines starting withkortex-cli, and fail if other lines exist) - analyze the command line, and check that:
- the command and subcommands exist
- the flags are supported
Aliases commands will inherit Example from their original command, by replacing the original command with the alias
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels