mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2025-02-02 05:41:10 -08:00
feat(debug): provide shell name on debug
This commit is contained in:
parent
ffd961fc6c
commit
9e73b15a3b
|
@ -16,19 +16,25 @@ import (
|
|||
|
||||
// debugCmd represents the prompt command
|
||||
var debugCmd = &cobra.Command{
|
||||
Use: "debug",
|
||||
Use: "debug [bash|zsh|fish|powershell|pwsh|cmd|nu|tcsh|elvish|xonsh]",
|
||||
Short: "Print the prompt in debug mode",
|
||||
Long: "Print the prompt in debug mode.",
|
||||
Args: cobra.NoArgs,
|
||||
Run: func(_ *cobra.Command, _ []string) {
|
||||
ValidArgs: supportedShells,
|
||||
Args: NoArgsOrOneValidArg,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
startTime := time.Now()
|
||||
|
||||
if len(args) == 0 {
|
||||
_ = cmd.Help()
|
||||
return
|
||||
}
|
||||
|
||||
env := &runtime.Terminal{
|
||||
CmdFlags: &runtime.Flags{
|
||||
Config: configFlag,
|
||||
Debug: true,
|
||||
PWD: pwd,
|
||||
Shell: shellName,
|
||||
Shell: args[0],
|
||||
Plain: plain,
|
||||
},
|
||||
}
|
||||
|
|
|
@ -15,14 +15,9 @@ var (
|
|||
printOutput bool
|
||||
strict bool
|
||||
manual bool
|
||||
debug bool
|
||||
|
||||
initCmd = &cobra.Command{
|
||||
Use: "init [bash|zsh|fish|powershell|pwsh|cmd|nu|tcsh|elvish|xonsh]",
|
||||
Short: "Initialize your shell and config",
|
||||
Long: `Initialize your shell and config.
|
||||
|
||||
See the documentation to initialize your shell: https://ohmyposh.dev/docs/installation/prompt.`,
|
||||
ValidArgs: []string{
|
||||
supportedShells = []string{
|
||||
"bash",
|
||||
"zsh",
|
||||
"fish",
|
||||
|
@ -33,7 +28,15 @@ See the documentation to initialize your shell: https://ohmyposh.dev/docs/instal
|
|||
"tcsh",
|
||||
"elvish",
|
||||
"xonsh",
|
||||
},
|
||||
}
|
||||
|
||||
initCmd = &cobra.Command{
|
||||
Use: "init [bash|zsh|fish|powershell|pwsh|cmd|nu|tcsh|elvish|xonsh]",
|
||||
Short: "Initialize your shell and config",
|
||||
Long: `Initialize your shell and config.
|
||||
|
||||
See the documentation to initialize your shell: https://ohmyposh.dev/docs/installation/prompt.`,
|
||||
ValidArgs: supportedShells,
|
||||
Args: NoArgsOrOneValidArg,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
if len(args) == 0 {
|
||||
|
|
Loading…
Reference in a new issue