Skip to content

Export GuessShell #19

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jul 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions completion_installer.go
Original file line number Diff line number Diff line change
@@ -70,9 +70,9 @@ Add this to the end of your shell configuration file (e.g. <info>"{{ call .RcFil
CompletionFile func() string
}{
Command: command,
Shell: guessShell,
Shell: GuessShell,
RcFile: func() string {
switch guessShell() {
switch GuessShell() {
case "fish":
return "~/.config/fish/config.fish"
case "zsh":
@@ -82,7 +82,7 @@ Add this to the end of your shell configuration file (e.g. <info>"{{ call .RcFil
}
},
CompletionFile: func() string {
switch guessShell() {
switch GuessShell() {
case "fish":
return fmt.Sprintf("/etc/fish/completions/%s.fish", application.HelpName)
case "zsh":
@@ -107,7 +107,7 @@ Add this to the end of your shell configuration file (e.g. <info>"{{ call .RcFil
Action: func(c *Context) error {
shell := c.Args().Get("shell")
if shell == "" {
shell = guessShell()
shell = GuessShell()
}

templates, err := template.ParseFS(CompletionTemplates, "resources/*")
@@ -136,6 +136,6 @@ Add this to the end of your shell configuration file (e.g. <info>"{{ call .RcFil
},
}

func guessShell() string {
func GuessShell() string {
return path.Base(os.Getenv("SHELL"))
}