Start from parse_options and work down the file adding lines and functions as necessary.
For example: mokctl get clusters OPTIONAL_NAME:
-
Add help text to
usage(). -
Add a
get_command_help()function. -
Add to
check_command_token(). -
Add to
check_subcommand_token(). -
Create a new function,
check_get_subcommand_token().This command takes one option, so set
STATE=OPTION. -
Add to
check_option_token(). -
Add a new global at the top of the file.
-
Add new tests to
tests/unit-tests.sh. -
Add command to
main(). -
Add
do_get(). -
Add `do_get_clusters_sanity_checks().
-
In ‘MUTATIONS’ section add
do_get_clusters_mutate().
The outcome is shown in the commit:
Add 'mokctl get cluster OPTIONAL_NAME' command · mclarkson/my-own-kind@6ba00b3 · GitHub
Which is not totally clear, so will do another one soon... hopefully...