Add --shell argument
Add subshell argument --shell. Currently, support only bash, which is also the default value.
This commit is contained in:
parent
d63f7d4bf2
commit
abd9a984eb
@ -355,5 +355,9 @@ func GetKubeConfig(c *cli.Context) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func Shell(c *cli.Context) error {
|
func Shell(c *cli.Context) error {
|
||||||
|
if c.String("shell") != "bash" {
|
||||||
|
return fmt.Errorf("%s is not supported. Only bash is supported", c.String("shell"))
|
||||||
|
}
|
||||||
|
|
||||||
return bashShell(c.String("name"), c.String("command"))
|
return bashShell(c.String("name"), c.String("command"))
|
||||||
}
|
}
|
||||||
|
5
main.go
5
main.go
@ -59,6 +59,11 @@ func main() {
|
|||||||
Name: "command, c",
|
Name: "command, c",
|
||||||
Usage: "Run a shell command in the context of the cluster",
|
Usage: "Run a shell command in the context of the cluster",
|
||||||
},
|
},
|
||||||
|
cli.StringFlag{
|
||||||
|
Name: "shell, s",
|
||||||
|
Value: "bash",
|
||||||
|
Usage: "Sub shell type. Only bash is supported. (default bash)",
|
||||||
|
},
|
||||||
},
|
},
|
||||||
Action: run.Shell,
|
Action: run.Shell,
|
||||||
},
|
},
|
||||||
|
Loading…
Reference in New Issue
Block a user