diff --git a/pkg/actions/env/common.go b/pkg/actions/env/common.go index 0035a7c15f..f33613c344 100644 --- a/pkg/actions/env/common.go +++ b/pkg/actions/env/common.go @@ -4,18 +4,25 @@ import ( _os "os" "github.com/rsteube/carapace" + "github.com/rsteube/carapace-bridge/pkg/actions/bridge" ) func init() { knownVariables["common"] = variables{ Names: map[string]string{ + "BROWSER": "the browser to use", + "EDITOR": "the editor to use", "HTTP_PROXY": "http proxy server", - "HTTP_TIMEOUT": "The HTTP timeout in seconds", "HTTPS_PROXY": "https proxy server", + "HTTP_TIMEOUT": "The HTTP timeout in seconds", + "PAGER": "the pager to use", "PATH": "A list of directories to be searched when executing commands", }, Completion: map[string]carapace.Action{ - "PATH": carapace.ActionDirectories().List(string(_os.PathListSeparator)).NoSpace(), + "BROWSER": bridge.ActionCarapaceBin().Split(), + "EDITOR": bridge.ActionCarapaceBin().Split(), + "PAGER": bridge.ActionCarapaceBin().Split(), + "PATH": carapace.ActionDirectories().List(string(_os.PathListSeparator)).NoSpace(), }, } diff --git a/pkg/actions/env/starship.go b/pkg/actions/env/starship.go new file mode 100644 index 0000000000..e9280fca1f --- /dev/null +++ b/pkg/actions/env/starship.go @@ -0,0 +1,38 @@ +package env + +import ( + "github.com/rsteube/carapace" + "github.com/rsteube/carapace/pkg/style" +) + +func init() { + knownVariables["starship"] = variables{ + Names: map[string]string{ + "STARSHIP_CACHE": "cache location", + "STARSHIP_CONFIG": "config location", + "STARSHIP_LOG": "log level", + "STARSHIP_NUM_THREADS": "number of threads", + "STARSHIP_SESSION_KEY": "session key", + "STARSHIP_SHELL": "shell", + }, + Completion: map[string]carapace.Action{ + "STARSHIP_CACHE": carapace.ActionDirectories(), + "STARSHIP_CONFIG": carapace.ActionFiles(), + "STARSHIP_LOG": carapace.ActionValues("debug", "error", "info", "trace", "warn").StyleF(style.ForLogLevel), + "STARSHIP_SHELL": carapace.ActionValues( + "bash", + "cmd", + "elvish", + "fish", + "ion", + "nu", + "powershell", + "pwsh", + "tcsh", + "xonsh", + "zsh", + ), + }, + } + +}