-
-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add process that generate bash/fish/zsh completion file
- Loading branch information
Showing
2 changed files
with
203 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
package completion | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/nao1215/gup/internal/cmdinfo" | ||
) | ||
|
||
// BashCompletionFilePath return bash-completion file path. | ||
func BashCompletionFilePath() string { | ||
return filepath.Join(os.Getenv("HOME"), ".config", "bash_completion.d", cmdinfo.Name()) | ||
} | ||
|
||
// FishCompletionFilePath return fish-completion file path. | ||
func FishCompletionFilePath() string { | ||
return filepath.Join(os.Getenv("HOME"), ".config", "fish", "completions", cmdinfo.Name()+".fish") | ||
} | ||
|
||
// ZshCompletionFilePath return zsh-completion file path. | ||
func ZshCompletionFilePath() string { | ||
return filepath.Join(os.Getenv("HOME"), ".zsh", "completion", "_"+cmdinfo.Name()) | ||
} | ||
|
||
// ZshrcPath return .zshrc path. | ||
func ZshrcPath() string { | ||
return filepath.Join(os.Getenv("HOME"), ".zshrc") | ||
} |