Do nothing on empty input
This commit is contained in:
@@ -11,6 +11,7 @@ func replCmdAction(cmd *cobra.Command, args []string) {
|
||||
PS1: "\rESDI > ",
|
||||
})
|
||||
repl.Start()
|
||||
repl.Close()
|
||||
}
|
||||
|
||||
// removeLabelCmd represents the removeLabel command
|
||||
|
||||
+5
-1
@@ -34,7 +34,7 @@ func NewREPL(cfg REPLCfg) *REPL {
|
||||
}
|
||||
}
|
||||
|
||||
func (r *REPL) CloseREPL() {
|
||||
func (r *REPL) Close() {
|
||||
// Do whatever cleanup we have to do
|
||||
}
|
||||
|
||||
@@ -60,6 +60,10 @@ func (r *REPL) mainLoop() {
|
||||
}
|
||||
|
||||
args := parseInput(strings.TrimSpace(line))
|
||||
if args[0] == "" {
|
||||
continue
|
||||
}
|
||||
|
||||
command, exists := r.Commands[args[0]]
|
||||
if exists {
|
||||
_ = command.Action(r, args[1:])
|
||||
|
||||
Reference in New Issue
Block a user