Skip to content

Commit 771f9c2

Browse files
committed
Fixes tests
1 parent ab5987c commit 771f9c2

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

go-core.bash

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -289,6 +289,9 @@ declare _GO_INJECT_MODULE_PATH="$_GO_INJECT_MODULE_PATH"
289289
if [[ "$_GO_HELP_HIJACK" == 'true' ]] \
290290
&& [[ " $* " == *' -h '* || " $* " == *' --help '* || " $* " == *' -help '* ]]; then
291291
cmd='help'
292+
if [[ "${1-}" == @(-h|-help|--help) && "$#" -gt 0 ]]; then
293+
shift
294+
fi
292295
else
293296
local cmd="${1-}"
294297
if [[ "$#" -gt 0 ]]; then
@@ -301,14 +304,14 @@ declare _GO_INJECT_MODULE_PATH="$_GO_INJECT_MODULE_PATH"
301304
_@go.source_builtin 'help' 1>&2
302305
return 1
303306
;;
307+
-h | -help | --help)
308+
cmd='help'
309+
;;
304310
-*)
305311
@go.printf "Unknown flag: $cmd\n\n"
306312
_@go.source_builtin 'help' 1>&2
307313
return 1
308314
;;
309-
-h | -help | --help)
310-
cmd='help'
311-
;;
312315
edit)
313316
if [[ -z "$EDITOR" ]]; then
314317
echo "Cannot edit $@: \$EDITOR not defined."

0 commit comments

Comments
 (0)