diff --git a/README.md b/README.md index b3f50d6..de08bb6 100644 --- a/README.md +++ b/README.md @@ -11,8 +11,6 @@ brew tap satococoa/tap brew install satococoa/tap/git-worktreeinclude ``` -Homebrew installs shell completions for `bash`, `zsh`, and `fish`. - ### Build ```sh @@ -117,30 +115,6 @@ Prints the recommended `post-checkout` hook snippet. git-worktreeinclude hook print post-checkout ``` -### `git-worktreeinclude completion ` - -Outputs a shell completion script generated by the CLI framework. - -```sh -git-worktreeinclude completion zsh -``` - -Examples: - -```sh -# bash -source <(git-worktreeinclude completion bash) - -# zsh -source <(git-worktreeinclude completion zsh) - -# fish -git-worktreeinclude completion fish > ~/.config/fish/completions/git-worktreeinclude.fish - -# pwsh -git-worktreeinclude completion pwsh | Out-String | Invoke-Expression -``` - ## JSON output `apply --json` emits a single JSON object to stdout. diff --git a/internal/cli/cli.go b/internal/cli/cli.go index 3cabd52..0b796ae 100644 --- a/internal/cli/cli.go +++ b/internal/cli/cli.go @@ -49,14 +49,10 @@ func (a *App) Run(args []string) int { func (a *App) newRootCommand() *ucli.Command { return &ucli.Command{ - Name: "git-worktreeinclude", - Usage: "apply ignored files listed in .worktreeinclude between Git worktrees", - Writer: a.stdout, - ErrWriter: a.stderr, - EnableShellCompletion: true, - ConfigureShellCompletionCommand: func(cmd *ucli.Command) { - cmd.Hidden = false - }, + Name: "git-worktreeinclude", + Usage: "apply ignored files listed in .worktreeinclude between Git worktrees", + Writer: a.stdout, + ErrWriter: a.stderr, OnUsageError: a.onUsageError, ExitErrHandler: a.handleExitError, Commands: []*ucli.Command{ diff --git a/internal/cli/cli_integration_test.go b/internal/cli/cli_integration_test.go index e7565dd..0c7d195 100644 --- a/internal/cli/cli_integration_test.go +++ b/internal/cli/cli_integration_test.go @@ -430,19 +430,6 @@ func TestUsageErrorWritesHelpToStderr(t *testing.T) { } } -func TestCompletionCommand(t *testing.T) { - tmpDir := t.TempDir() - for _, shell := range []string{"bash", "zsh", "fish", "pwsh"} { - stdout, stderr, code := runCmd(t, tmpDir, nil, testBinary, "completion", shell) - if code != 0 { - t.Fatalf("completion %s exit code=%d stderr=%s", shell, code, stderr) - } - if strings.TrimSpace(stdout) == "" { - t.Fatalf("completion %s should not be empty", shell) - } - } -} - func TestHookPrintUsageErrorShowsHelpOnStderr(t *testing.T) { fx := setupFixture(t)