Skip to content

[ENHANCEMENT] Updated "Command Not Found" prompt to provide guidance for available commands#78

Merged
anshumanjadiya1102 merged 1 commit intoDrive-for-Java:mainfrom
Ishara-Vithanage:main
Oct 27, 2025
Merged

[ENHANCEMENT] Updated "Command Not Found" prompt to provide guidance for available commands#78
anshumanjadiya1102 merged 1 commit intoDrive-for-Java:mainfrom
Ishara-Vithanage:main

Conversation

@Ishara-Vithanage
Copy link
Contributor

@Ishara-Vithanage Ishara-Vithanage commented Oct 26, 2025

fixed #8
This pull request introduces an improved user experience for command recognition and enhances the documentation for the date command. The most important changes are:

User feedback improvements:

  • Updated the error message for unrecognized commands in App.java to provide a clearer explanation and suggest using the help command for assistance.

Command documentation enhancements:

  • Added description() and usage() methods to the DateCommand class to provide command documentation, improving help and discoverability.

Summary by CodeRabbit

  • Bug Fixes

    • Improved error messages for unrecognized commands with clearer, cross-platform guidance directing users to the help command.
  • New Features

    • Extended command metadata to include descriptions and usage information, enabling better help documentation and command discovery.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Oct 26, 2025

Walkthrough

The PR improves user-facing error messaging for unrecognized commands with a clearer, cross-platform message and adds metadata methods to the DateCommand class to provide human-readable command information without changing execution behavior.

Changes

Cohort / File(s) Summary
Error Message Enhancement
src/main/java/com/mycmd/App.java
Updated unrecognized command error message from Windows-style format to a user-friendly, cross-platform message that suggests using 'help' command
Command Metadata
src/main/java/com/mycmd/commands/DateCommand.java
Added description() and usage() method overrides to provide human-readable metadata ("Display current date." and "date" respectively)

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~5 minutes

  • Verify error message text change is accurately reflected in App.java
  • Confirm DateCommand method implementations return expected string literals
  • Ensure no unintended modifications to control flow or execution logic

Poem

🐰 A message now gleams, so helpful and bright,
With "help" gently guiding through commands alight,
And DateCommand speaks what it does with such grace,
"Display current date"—a smile on its face! 🌙

Pre-merge checks and finishing touches

❌ Failed checks (1 warning)
Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 25.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The pull request title "[ENHANCEMENT] Updated "Command Not Found" prompt to provide guidance for available commands" directly and clearly describes the primary change in the changeset. The title captures the main objective of replacing the generic error message with a more helpful one that guides users toward the help command. While the changeset also includes additions to DateCommand class, those are supporting enhancements that don't constitute the primary focus, and the title effectively communicates the core improvement without requiring comprehensive coverage of all modifications.
Linked Issues Check ✅ Passed The code changes directly satisfy all coding-related requirements from issue #8. The error message in App.java now identifies the unrecognized command ("Unknown command: ''") and suggests the help command ("Enter 'help' to list all available commands"), fulfilling the core requirement to make the error message more helpful and interactive. The additions of description() and usage() methods to DateCommand directly support the help system's functionality and enhance the ability of the help command to provide meaningful information to users about available commands, which is essential to making the suggested help command useful.
Out of Scope Changes Check ✅ Passed All changes in the pull request are directly scoped to the requirements of issue #8. The primary change to App.java updates the error message as explicitly requested in the issue. The secondary changes to DateCommand are supporting enhancements that enable the help system to provide meaningful information about commands, which directly facilitates the recommendation to use the help command. These additions are necessary and tightly coupled to the main objective of guiding users toward discovering available commands.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment

📜 Recent review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 810028b and 8f23db8.

📒 Files selected for processing (2)
  • src/main/java/com/mycmd/App.java (1 hunks)
  • src/main/java/com/mycmd/commands/DateCommand.java (1 hunks)
🔇 Additional comments (2)
src/main/java/com/mycmd/App.java (1)

45-45: Excellent improvement to user experience!

The updated error message is clear, actionable, and user-friendly. It properly guides users to the help command for discovering available commands, which aligns perfectly with the PR objectives.

src/main/java/com/mycmd/commands/DateCommand.java (1)

26-34: This review comment is incorrect and should be ignored.

The Command interface was deliberately designed with default implementations for description() and usage() specifically to allow existing implementations to not override them. "Default is empty so existing implementations do not break."

The DateCommand implementation is correct and complete—it properly overrides both methods with meaningful values. There is no consistency issue; the codebase intentionally allows commands to optionally provide these metadata methods. No changes are required.

Likely an incorrect or invalid review comment.


Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Contributor

🚀 Hi @Ishara-Vithanage!

Thank you for contributing to MyCMD. A maintainer will review your PR shortly. 🎉

@anshumanjadiya1102
Copy link
Member

Nice work @Ishara-Vithanage, I have invited you to our Organization. Thanks for your support

@anshumanjadiya1102 anshumanjadiya1102 merged commit 45acb7b into Drive-for-Java:main Oct 27, 2025
4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

from-fork hacktoberfest This is for Hacktoberfest hacktoberfest-accepted This is for Hacktoberfest

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Enhancement: Improve 'Command Not Found' Error Message assigned to PedrinDev1447

2 participants