added flags to help message #41
Merged@github-juk3n wants to merge
40-add-version-to-command-list-description into mainMerged as
86f9a95ccb23.2 files changed
modified
app/include/fluffyApplication.hpp +10 -0 | @@ -25,6 +25,16 @@ private: | ||
| 25 | 25 | std::unique_ptr<GameRepositoryInterface> gameRepository = nullptr; |
| 26 | 26 | std::shared_ptr<Output> output{}; |
| 27 | 27 | std::string version{ "v0.1.3" }; |
| 28 | + std::string helpMessage{ | |
| 29 | + "usage: fluffy [--flag | <command> <args>]\n\ | |
| 30 | +fluffy flags:\n\ | |
| 31 | + --help\n\ | |
| 32 | + --version\n\ | |
| 33 | +fluffy commands:\n\ | |
| 34 | + play <game_name> Runs a game\n\ | |
| 35 | + add <game_name> <game_path> Add a game library\n\ | |
| 36 | + show Show all games added to library\n\ | |
| 37 | + rm <game_name> Remove game from a library"}; | |
| 28 | 38 | |
| 29 | 39 | auto addGame(Database& database, std::string name, std::string path) -> void; |
| 30 | 40 | |
| @@ -25,6 +25,16 @@ private: | |||
| 25 | std::unique_ptr<GameRepositoryInterface> gameRepository = nullptr; | 25 | std::unique_ptr<GameRepositoryInterface> gameRepository = nullptr; |
| 26 | std::shared_ptr<Output> output{}; | 26 | std::shared_ptr<Output> output{}; |
| 27 | std::string version{ "v0.1.3" }; | 27 | std::string version{ "v0.1.3" }; |
| 28 | + std::string helpMessage{ | ||
| 29 | + "usage: fluffy [--flag | <command> <args>]\n\ | ||
| 30 | +fluffy flags:\n\ | ||
| 31 | + --help\n\ | ||
| 32 | + --version\n\ | ||
| 33 | +fluffy commands:\n\ | ||
| 34 | + play <game_name> Runs a game\n\ | ||
| 35 | + add <game_name> <game_path> Add a game library\n\ | ||
| 36 | + show Show all games added to library\n\ | ||
| 37 | + rm <game_name> Remove game from a library"}; | ||
| 28 | 38 | ||
| 29 | auto addGame(Database& database, std::string name, std::string path) -> void; | 39 | auto addGame(Database& database, std::string name, std::string path) -> void; |
| 30 | 40 | ||
modified
app/src/fluffyApplication.cpp +1 -5 | @@ -49,11 +49,7 @@ auto FluffyApplication::handleCommand( | ||
| 49 | 49 | output->printMessage("fluffy " + version); |
| 50 | 50 | } |
| 51 | 51 | else if (command == "--help") { |
| 52 | - output->printMessage("fluffy commands:\n \ | |
| 53 | - play <game_name> Runs a game\n \ | |
| 54 | - add <game_name> <game_path> Add a game library\n \ | |
| 55 | - show Show all games added to library\n \ | |
| 56 | - rm <game_name> Remove game from a library"); | |
| 52 | + output->printMessage(this->helpMessage); | |
| 57 | 53 | } |
| 58 | 54 | else { |
| 59 | 55 | output->printMessage("fluffy: '" + command + "' is not a fluffy command. See 'fluffy --help'"); |
| @@ -49,11 +49,7 @@ auto FluffyApplication::handleCommand( | |||
| 49 | output->printMessage("fluffy " + version); | 49 | output->printMessage("fluffy " + version); |
| 50 | } | 50 | } |
| 51 | else if (command == "--help") { | 51 | else if (command == "--help") { |
| 52 | - output->printMessage("fluffy commands:\n \ | 52 | + output->printMessage(this->helpMessage); |
| 53 | - play <game_name> Runs a game\n \ | ||
| 54 | - add <game_name> <game_path> Add a game library\n \ | ||
| 55 | - show Show all games added to library\n \ | ||
| 56 | - rm <game_name> Remove game from a library"); | ||
| 57 | } | 53 | } |
| 58 | else { | 54 | else { |
| 59 | output->printMessage("fluffy: '" + command + "' is not a fluffy command. See 'fluffy --help'"); | 55 | output->printMessage("fluffy: '" + command + "' is not a fluffy command. See 'fluffy --help'"); |