Skip to content

Improve games command error message with helpful usage information#5

Merged
pardeike merged 2 commits intomainfrom
copilot/fix-0b410022-cdbb-4211-88ba-e341564ab380
Sep 13, 2025
Merged

Improve games command error message with helpful usage information#5
pardeike merged 2 commits intomainfrom
copilot/fix-0b410022-cdbb-4211-88ba-e341564ab380

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Sep 13, 2025

Problem

When users run gabs games without any arguments, they receive a terse and unfriendly error message:

➜  GABS git:(main) ./gabs games
2025-09-13T20:20:20.297+0200	INFO	util/log.go:57	starting gabs	{"version": "0.1.0", "commit": "unknown", "built": "unknown", "subcmd": "games"}
games subcommand requires an action: list|add|remove|show

This message is technical and doesn't provide helpful guidance for users who want to understand what they can do with the games command.

Solution

This PR replaces the terse error message with a friendly, helpful response that shows users exactly what they can do:

➜  GABS git:(main) ./gabs games
2025-09-13T18:25:04.852Z	INFO	util/log.go:57	starting gabs	{"version": "0.1.0", "commit": "unknown", "built": "unknown", "subcmd": "games"}
Please specify what you'd like to do with games.

Game Management Commands:
  gabs games list               List all configured games
  gabs games add <id>           Add a new game configuration (interactive)
  gabs games remove <id>        Remove a game configuration
  gabs games show <id>          Show details for a game

Examples:
  gabs games list               # See all your configured games
  gabs games add minecraft      # Add a new game called 'minecraft'
  gabs games show minecraft     # View configuration for 'minecraft'
  gabs games remove minecraft   # Remove the 'minecraft' configuration

Changes Made

  • Friendly error message: Changed from "games subcommand requires an action" to "Please specify what you'd like to do with games."
  • Added dedicated usage helper: Created showGamesUsage() function that displays all available games commands with descriptions
  • Practical examples: Included real-world examples showing how to use each command
  • Minimal impact: Only modified the no-arguments error case; all existing functionality remains unchanged

The new approach follows the same user-friendly style as the main usage() function, providing clear guidance instead of just stating what's wrong.


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Co-authored-by: pardeike <853584+pardeike@users.noreply.github.com>
Copilot AI changed the title [WIP] When running commands with no arguments but that require them, please make it show a more friendly message. Right now I get for example ➜ GABS git:(main) ./gabs games 2025-09-13T20:20:20.297+0200 INFO util/log.go:57 starting gabs {"version": "0.1.0... Improve games command error message with helpful usage information Sep 13, 2025
Copilot AI requested a review from pardeike September 13, 2025 18:26
@pardeike pardeike marked this pull request as ready for review September 13, 2025 18:50
@pardeike pardeike merged commit 30f8454 into main Sep 13, 2025
1 check passed
@pardeike pardeike deleted the copilot/fix-0b410022-cdbb-4211-88ba-e341564ab380 branch September 13, 2025 18:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants