ctrl+c on empty line exits (#135)
This commit is contained in:
parent
3b135ac963
commit
55b5f5dc34
1 changed files with 4 additions and 0 deletions
|
@ -276,6 +276,10 @@ func generateInteractive(cmd *cobra.Command, model string) error {
|
|||
case errors.Is(err, io.EOF):
|
||||
return nil
|
||||
case errors.Is(err, readline.ErrInterrupt):
|
||||
if line == "" {
|
||||
return nil
|
||||
}
|
||||
|
||||
continue
|
||||
case err != nil:
|
||||
return err
|
||||
|
|
Loading…
Reference in a new issue