diff --git a/lib/internal/complete b/lib/internal/complete index a187dd3..3390909 100644 --- a/lib/internal/complete +++ b/lib/internal/complete @@ -6,7 +6,11 @@ _@go.complete_top_level_commands() { _@go.source_builtin 'commands' else printf 'help\n' - _@go.source_builtin 'commands' "$_GO_SCRIPTS_DIR" + + local plugins_paths + printf -v plugins_paths '%s:' "${_GO_PLUGINS_PATHS[@]}" + plugins_paths="${plugins_paths%:}" + _@go.source_builtin 'commands' "$_GO_SCRIPTS_DIR:$plugins_paths" fi } diff --git a/tests/complete.bats b/tests/complete.bats index a77c0d6..256bda9 100644 --- a/tests/complete.bats +++ b/tests/complete.bats @@ -45,13 +45,13 @@ teardown() { assert_failure '' } -@test "$SUITE: _GO_STANDALONE only completes 'help' and project scripts" { +@test "$SUITE: _GO_STANDALONE only completes 'help' and custom scripts/plugins" { @go.create_test_command_script 'foo' @go.create_test_command_script 'bar' @go.create_test_command_script 'plugins/baz/bin/baz' _GO_STANDALONE='true' run "$TEST_GO_SCRIPT" complete 0 - assert_success 'help' 'bar' 'foo' + assert_success 'help' 'bar' 'baz' 'foo' } @test "$SUITE: cd and pushd complete directories" {