File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -34,7 +34,7 @@ func exitCtrlD() {
3434 text , _ := reader .ReadString ('\n' )
3535 answer := strings .TrimSpace (text )
3636
37- if (answer == "Y" ) || ( answer == "y" ) {
37+ if strings . EqualFold (answer , "y" ) {
3838 os .Exit (0 )
3939 }
4040}
Original file line number Diff line number Diff line change @@ -17,10 +17,13 @@ func ExecuteShell() *cobra.Command {
1717 Short : "Execute the remaining arguments with system shell" ,
1818 DisableFlagParsing : true ,
1919 RunE : func (_ * cobra.Command , args []string ) error {
20- if len (args ) == 0 {
20+ // Only at least one argument is needed, since the command
21+ // itself is stripped before those args are passed as an array.
22+ if len (args ) < 1 {
2123 return errors .New ("command requires one or more arguments" )
2224 }
2325
26+ // Above, the length of args is checked to be at least 2
2427 path , err := exec .LookPath (args [0 ])
2528 if err != nil {
2629 return err
You can’t perform that action at this time.
0 commit comments