diff --git a/README.md b/README.md index 2a70836..a0c04ea 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ Gold is a tool written in Zsh for golden testing on stdout/stderr of commands. Clone this repository, then execute: ```text -ln -v gold /usr/local/bin +cp -v gold /usr/local/bin ``` ## Usage @@ -40,30 +40,31 @@ ln -v gold /usr/local/bin Print the below message with `gold --help`. This is the public API. ```text -gold [--help|-h] - Display this help message. - -gold (--version|-v) - Display the version. - -gold - - Config file path, written in Zsh, which must define the following parameters: - - `test_cases`. Numerically indexed array with the name of the test cases. This allows gold - to know how many test cases should be executed and provides a tag to print for each test. - - `resources`. Holds the file path to a dir to provide data for the command. At a minimum, - it is expected that for each test case there is one golden file in this directory with - the name `_golden.txt`. - - `command`. Command to execute which output is compared against a golden file. The file can - be any valid Zsh command. Two strings are replaced before executing the command: with - the `resources` value and with the test case index (indices begin at 1). - - - list: List all test cases. - - run-all: Run all test cases. - - run : Run a single test case, by index. - - execute : Execute the command corresponding to a test case, by index. - - patch-all: Patch (fix with current diff output) all test cases. - - patch : Patch (fix with current diff output) a single test case, by index. +Usages: + gold [--help|-h] + Display this help message. + + gold (--version|-v) + Display the version. + + gold + + Config file path, written in Zsh, which must define the following parameters: + - `test_cases`. Numerically indexed array with the name of the test cases. This allows gold + to know how many test cases should be executed and provides a tag to print for each test. + - `resources`. Holds the file path to a dir to provide data for the command. At a minimum, + it is expected that for each test case there is one golden file in this directory with + the name `_golden.txt`. + - `command`. Command to execute which output is compared against a golden file. The file can + be any valid Zsh command. Two strings are replaced before executing the command: with + the `resources` value and with the test case index (indices begin at 1). + + - list: List all test cases. + - run-all: Run all test cases. + - run : Run a single test case, by index. + - execute : Execute the command corresponding to a test case, by index. + - patch-all: Patch (fix with current diff output) all test cases. + - patch : Patch (fix with current diff output) a single test case, by index. ``` For an example usage, refer to the directory [test](./test). diff --git a/gold b/gold index 3fe921c..ac592a5 100755 --- a/gold +++ b/gold @@ -1,8 +1,6 @@ #!/bin/zsh -f -typeset -r version='0.2.2' - -typeset -r help_message=' +typeset -r help_message='Usages: gold [--help|-h] Display this help message. @@ -38,7 +36,7 @@ fi # Form: gold (--version|-v) if [[ "${1}" = '--version' ]] || [[ "${1}" = '-v' ]]; then - echo "${version}" + echo '0.2.3' return 0 fi