Skip to content

Commit

Permalink
Improve error message wrong command (#32)
Browse files Browse the repository at this point in the history
  • Loading branch information
edu-diaz authored Jan 26, 2025
1 parent 979dca9 commit 0f0dcc9
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 3 deletions.
3 changes: 1 addition & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,8 @@ func main() {
func runCLICommand(rootCmd *cobra.Command, command string) string {
args := strings.Fields(command)

// Enforce the root command prefix
if len(args) == 0 || (args[0] != "kubectl" && args[0] != "k") {
return "Error: Commands must start with 'kubectl' or 'k'"
return fmt.Sprintf("Error: unknown command '%s'", args[0])
}

// Remove the root command prefix
Expand Down
2 changes: 1 addition & 1 deletion web/styles/terminal.css
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
height: 70%;
border-radius: 10px;
padding: 20px;
overflow: hidden; /* Prevents scrollbars */
overflow: vertical;
background-color: var(--background-color-dark);
color: var(--text-color-dark);
transition: transform var(--transition-duration) ease-in-out, opacity var(--transition-duration);
Expand Down

0 comments on commit 0f0dcc9

Please sign in to comment.