diff --git a/.trunk/configs/.yamllint.yaml b/.trunk/configs/.yamllint.yaml index a4b236e..3a3f2a1 100644 --- a/.trunk/configs/.yamllint.yaml +++ b/.trunk/configs/.yamllint.yaml @@ -5,6 +5,8 @@ ignore: | .travis.yml rules: + comments: + min-spaces-from-content: 1 document-start: disable line-length: disable truthy: diff --git a/src/commands/init.zsh b/src/commands/init.zsh index b7555bb..569c48c 100644 --- a/src/commands/init.zsh +++ b/src/commands/init.zsh @@ -13,7 +13,6 @@ function _zunit_init_usage() { echo echo "$(color yellow 'Options:')" echo " -h, --help Output help text and exit" - echo " -v, --version Output version information and exit" echo " -g, --github-actions Generate .github/workflows/zunit.yml in project" echo " -t, --travis Generate legacy .travis.yml in project" } diff --git a/tests/cli.zunit b/tests/cli.zunit index 8f3efef..539e6fc 100644 --- a/tests/cli.zunit +++ b/tests/cli.zunit @@ -34,10 +34,19 @@ } @test 'report output without config points users to zunit init' { - local sandbox + local sandbox stubbin sandbox="$(mktemp -d)" + stubbin="$sandbox/.bin" + + mkdir -p "$stubbin" + print -r -- '#!/usr/bin/env zsh' > "$stubbin/revolver" + print -r -- 'exit 0' >> "$stubbin/revolver" + print -r -- '#!/usr/bin/env zsh' > "$stubbin/color" + print -r -- 'print -r -- "${@: -1}"' >> "$stubbin/color" + chmod u+x "$stubbin/revolver" "$stubbin/color" cd "$sandbox" + PATH="$stubbin:/usr/bin:/bin" run "$OLDPWD/zunit" --output-text assert "$state" equals 1 @@ -50,6 +59,7 @@ assert "$state" equals 0 assert "$output" contains '--github-actions' + assert "$output" does_not_contain '--version' } @test 'init can generate GitHub Actions workflow' {