aboutsummaryrefslogtreecommitdiff
path: root/src/cmd_usage.cc
diff options
context:
space:
mode:
authorYour Name <you@example.com>2021-05-06 14:13:28 -0400
committerYour Name <you@example.com>2021-05-06 14:13:28 -0400
commit9f3802690f9dd9452e96d1d7a879291978d66e35 (patch)
tree6d6c17b39abdb9490119241bc4fc061744b46d7d /src/cmd_usage.cc
parent2a9f262e6db5906db445d465e500d7ba8c90fab3 (diff)
downloaddmtool-9f3802690f9dd9452e96d1d7a879291978d66e35.tar.gz
dmtool-9f3802690f9dd9452e96d1d7a879291978d66e35.tar.bz2
dmtool-9f3802690f9dd9452e96d1d7a879291978d66e35.zip
Refactoring
Diffstat (limited to 'src/cmd_usage.cc')
-rw-r--r--src/cmd_usage.cc47
1 files changed, 47 insertions, 0 deletions
diff --git a/src/cmd_usage.cc b/src/cmd_usage.cc
new file mode 100644
index 0000000..03dae56
--- /dev/null
+++ b/src/cmd_usage.cc
@@ -0,0 +1,47 @@
+#include "cmd.h"
+#include <sstream>
+#include <string>
+
+namespace cmd {
+ std::string usage(const std::string& exename) {
+ std::stringstream text;
+ text << "Usage:" << std::endl;
+ std::string indOpt = " " + exename + " ";
+ std::string indDesc = " ";
+ text << indOpt << "[ls] [subfolder]" << std::endl;
+ text << indDesc << "List creatures and objects." << std::endl;
+ text << indOpt << "cp old-path new-path" << std::endl;
+ text << indDesc << "Copy old-path to new-path, instantiating it." << std::endl;
+ text << indOpt << "mkdir path" << std::endl;
+ text << indDesc << "Make a new directory for holding creatures and objects." << std::endl;
+ text << indOpt << "mv old-path new-path" << std::endl;
+ text << indDesc << "Move old-path to new-path." << std::endl;
+ text << indOpt << "rm path" << std::endl;
+ text << indDesc << "Remove existing creature, object, or directory." << std::endl;
+ text << indOpt << "attacks path" << std::endl;
+ text << indDesc << "List attacks available for a creature" << std::endl;
+ text << indOpt << "roll path name" << std::endl;
+ text << indDesc << "Roll a skill check, save, or attack." << std::endl;
+ text << indOpt << "damage path amount [type] [--magical,-m] [--silvered,-s] [--adamantine,-a]" << std::endl;
+ text << indDesc << "Damage creature by amount. Type defaults to \"force\"." << std::endl;
+ text << indOpt << "heal path amount" << std::endl;
+ text << indDesc << "Heal creature by amount." << std::endl;
+ text << indOpt << "reset path" << std::endl;
+ text << indDesc << "Reset creature to full health (as if completing a long rest)." << std::endl;
+ text << indOpt << "set path field value" << std::endl;
+ text << indDesc << "Set a field to a new value, where field is any of:" << std::endl;
+ text << indDesc << " ability (str, dex, con, int, wis, cha); value is new ability score" << std::endl;
+ text << indDesc << " skill (athletics, \"sleight of hand\", etc.); value is (none|proficient|expert)" << std::endl;
+ text << indDesc << " proficiency; value is new proficency bonus." << std::endl;
+ text << indDesc << " name; value is new given name." << std::endl;
+ text << indOpt << "edit path" << std::endl;
+ text << indDesc << "Edit notes associated with creature." << std::endl;
+ text << indOpt << "add path entry" << std::endl;
+ text << indDesc << "Add entry to creature, where entry is an item or spell." << std::endl;
+ text << indOpt << "del path entry" << std::endl;
+ text << indDesc << "Delete entry from creature, where entry is an item or spell." << std::endl;
+ text << indOpt << "help" << std::endl;
+ text << indDesc << "Show this help." << std::endl;
+ return text.str();
+ }
+}