File tree Expand file tree Collapse file tree 1 file changed +7
-2
lines changed
Expand file tree Collapse file tree 1 file changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -67,15 +67,20 @@ func createListCommand() *cobra.Command {
6767
6868func createExecCommand () * cobra.Command {
6969 cmd := & cobra.Command {
70- Use : "exec DEVCONTAINER_NAME COMMAND [args...]" ,
70+ Use : "exec DEVCONTAINER_NAME COMMAND [args...] (args will default to /bin/bash if none provided) " ,
7171 Short : "Execute a command in a devcontainer" ,
7272 Long : "Execute a command in a devcontainer, similar to `docker exec`. Pass `?` as DEVCONTAINER_NAME to be prompted." ,
7373 RunE : func (cmd * cobra.Command , args []string ) error {
7474
75- if len (args ) < 2 {
75+ if len (args ) < 1 {
7676 return cmd .Usage ()
7777 }
7878
79+ // Default to executing /bin/bash
80+ if (len (args ) == 1 ) {
81+ args = append (args , "/bin/bash" )
82+ }
83+
7984 devcontainerName := args [0 ]
8085 devcontainerList , err := devcontainers .ListDevcontainers ()
8186 if err != nil {
You can’t perform that action at this time.
0 commit comments