mirror of
https://github.com/JanDeDobbeleer/oh-my-posh.git
synced 2024-12-28 04:19:41 -08:00
fix(cli): check for empty args(cache/get)
This commit is contained in:
parent
63802ca046
commit
96df24789d
12
.vscode/launch.json
vendored
12
.vscode/launch.json
vendored
|
@ -122,6 +122,16 @@
|
||||||
"request": "attach",
|
"request": "attach",
|
||||||
"port": 9229,
|
"port": 9229,
|
||||||
"preDebugTask": "func: host start"
|
"preDebugTask": "func: host start"
|
||||||
}
|
},
|
||||||
|
{
|
||||||
|
"name": "Debug CLI(cache)",
|
||||||
|
"type": "go",
|
||||||
|
"request": "launch",
|
||||||
|
"mode": "debug",
|
||||||
|
"program": "${workspaceRoot}/src",
|
||||||
|
"args": [
|
||||||
|
"cache",
|
||||||
|
]
|
||||||
|
},
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
|
@ -32,6 +32,10 @@ You can do the following:
|
||||||
},
|
},
|
||||||
Args: cobra.OnlyValidArgs,
|
Args: cobra.OnlyValidArgs,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
if len(args) == 0 {
|
||||||
|
_ = cmd.Help()
|
||||||
|
return
|
||||||
|
}
|
||||||
env := &environment.ShellEnvironment{
|
env := &environment.ShellEnvironment{
|
||||||
Version: cliVersion,
|
Version: cliVersion,
|
||||||
}
|
}
|
||||||
|
|
|
@ -27,6 +27,10 @@ This command is used to get the value of the following variables:
|
||||||
},
|
},
|
||||||
Args: cobra.OnlyValidArgs,
|
Args: cobra.OnlyValidArgs,
|
||||||
Run: func(cmd *cobra.Command, args []string) {
|
Run: func(cmd *cobra.Command, args []string) {
|
||||||
|
if len(args) == 0 {
|
||||||
|
_ = cmd.Help()
|
||||||
|
return
|
||||||
|
}
|
||||||
env := &environment.ShellEnvironment{
|
env := &environment.ShellEnvironment{
|
||||||
Version: cliVersion,
|
Version: cliVersion,
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue