defer terminal restoration
add delete aliases
This commit is contained in:
@@ -29,6 +29,8 @@ func RunREPL(ctx context.Context, config cli.CLIConfig) error {
|
|||||||
return fmt.Errorf("failed to get terminal state: %w", err)
|
return fmt.Errorf("failed to get terminal state: %w", err)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
defer term.Restore(int(os.Stdin.Fd()), oldState)
|
||||||
|
|
||||||
svc, cleanup, err := service.NewServices(ctx, config)
|
svc, cleanup, err := service.NewServices(ctx, config)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return fmt.Errorf("failed to initialize services: %w", err)
|
return fmt.Errorf("failed to initialize services: %w", err)
|
||||||
@@ -87,10 +89,7 @@ func RunREPL(ctx context.Context, config cli.CLIConfig) error {
|
|||||||
|
|
||||||
args := strings.Fields(pmCmd)
|
args := strings.Fields(pmCmd)
|
||||||
|
|
||||||
output, err := commands.ExecuteArgsString(args)
|
output, _ := commands.ExecuteArgsString(args)
|
||||||
if err != nil {
|
|
||||||
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
if output != "" {
|
if output != "" {
|
||||||
fmt.Println(styles.CommandStyle.Render(output))
|
fmt.Println(styles.CommandStyle.Render(output))
|
||||||
@@ -110,10 +109,6 @@ func RunREPL(ctx context.Context, config cli.CLIConfig) error {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if err := term.Restore(int(os.Stdin.Fd()), oldState); err != nil {
|
|
||||||
return fmt.Errorf("failed to restore terminal state: %w", err)
|
|
||||||
}
|
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -219,7 +214,7 @@ func flagSuggestions(cmd string, words []string, text string) []prompt.Suggest {
|
|||||||
case "describe", "get", "read":
|
case "describe", "get", "read":
|
||||||
return issueIdSuggestions(words)
|
return issueIdSuggestions(words)
|
||||||
|
|
||||||
case "delete":
|
case "delete", "del", "rm", "remove":
|
||||||
return issueIdSuggestions(words)
|
return issueIdSuggestions(words)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user