Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add static CommandDictionary method to get standardized command usage messages #283

Merged
merged 9 commits into from
Nov 1, 2019

Conversation

Raghav-B
Copy link

@Raghav-B Raghav-B commented Oct 31, 2019

Previously, formatting of usage error messages resulting from incomplete or invalid user input in Parser was explicitly typed as a String for every InsufficientInfoException thrown in Parser.

This makes these messages unstandardized, and begs the need for some sort of abstraction of functionality. To do this, I've added a static method in CommandDictionary called getCommandUsage(), which takes in any part of a command and returns all possible usages of that command.

For example, appropriate inputs would be list, list stock, delete, delete person, etc.

Perhaps we could look into calling this within the HelpCommand for even further standardization?

@Raghav-B Raghav-B added this to the v1.4 milestone Oct 31, 2019

// Lost Commands
commandDict.add(new Pair<>("lost", "<Stock Code> <Quantity>"));
commandDict.add(new Pair<>("lost", "<StockCode> <Quantity>"));
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

standardised yes v good

Copy link

@cyanoei cyanoei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

a very useful update. thanks

@cyanoei cyanoei merged commit 066cf27 into AY1920S1-CS2113T-F09-3:master Nov 1, 2019
cyanoei added a commit to cyanoei/eggventory-team that referenced this pull request Nov 1, 2019
* 'master' of https://github.com/AY1920S1-CS2113T-F09-3/main:
  Add static CommandDictionary method to get standardized command usage messages (AY1920S1-CS2113T-F09-3#283)
  Ui.png update (AY1920S1-CS2113T-F09-3#282)
  Test commands (AY1920S1-CS2113T-F09-3#280)
  Help YanBo tag his code (AY1920S1-CS2113T-F09-3#279)
cyanoei added a commit to cyanoei/eggventory-team that referenced this pull request Nov 1, 2019
… into authortags_update

* 'master' of https://github.com/AY1920S1-CS2113T-F09-3/main:
  Loan add backend (AY1920S1-CS2113T-F09-3#284)
  Add static CommandDictionary method to get standardized command usage messages (AY1920S1-CS2113T-F09-3#283)
  Ui.png update (AY1920S1-CS2113T-F09-3#282)
  Test commands (AY1920S1-CS2113T-F09-3#280)
  Help YanBo tag his code (AY1920S1-CS2113T-F09-3#279)
  Fixed error with loading of stock from .csv (AY1920S1-CS2113T-F09-3#278)
  List stocktype multi args (AY1920S1-CS2113T-F09-3#275)
  Ug in Markdown (AY1920S1-CS2113T-F09-3#276)
  Input fix for cross-platform use cases (AY1920S1-CS2113T-F09-3#277)
  List person command (AY1920S1-CS2113T-F09-3#271)
  Update ug (AY1920S1-CS2113T-F09-3#274)

# Conflicts:
#	src/main/java/eggventory/model/items/UniqueStock.java
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