diff --git a/docs/commands/commands.js b/docs/commands/commands.js index c6a31c5f..215bca8c 100644 --- a/docs/commands/commands.js +++ b/docs/commands/commands.js @@ -1,5 +1,5 @@ module.exports = { - "system-new": { + systemNew: { title: "Create a new system", summary: "Creates a new system if you do not already have one.", usage: [ @@ -10,7 +10,7 @@ "system-name": {type: "string", desc: "the name of the system to create", optional: true} } }, - "system-info": { + systemInfo: { title: "Look up info about a system", summary: "Shows a system card, either your own or someone else's.", usage: [ @@ -20,5 +20,36 @@ arguments: { "target": {type: "system", desc: "the system to look up"} } + }, + systemName: { + ...systemSetterCommand("system name", "system name", "new-name", "Boxes of Foxes"), + title: "Rename your system" + }, + systemDesc: { + ...systemSetterCommand("system desc", "system description", "new-description", "Here is my cool new description!", {withRaw: true}) + }, + +}; + +function systemSetterCommand(cmdPrefix, valueName, valueArg, exampleVal = "example-value", {argType = "string", withRaw = false} = {}) { + var args = {}; + args[valueArg] = {type: argType, desc: `the new ${valueName}.`}; + return { + title: `Change your ${valueName}`, + summary: `Adds, changes, or removes your ${valueName}.`, + usage: [ + {cmd: cmdPrefix, desc: `Shows your current ${valueName}.`}, + {cmd: `${cmdPrefix} \`${valueArg}\``, desc: `Sets your ${valueName}.`} + ], + examples: [ + {cmd: cmdPrefix, desc: `Shows your current ${valueName}.`}, + {cmd: `${cmdPrefix} -clear`, desc: `Clears your ${valueName}.`}, + {cmd: `${cmdPrefix} \`${exampleVal}\``, desc: `Changes your ${valueName} to '${exampleVal}'`} + ], + flags: { + clear: {desc: `Clear the current ${valueName}.`}, + ...(withRaw ? {raw: {desc: `Show the current ${valueName} in raw form, to copy/paste formatting more easily.`}} : {}) + }, + arguments: args } -}; \ No newline at end of file +} \ No newline at end of file diff --git a/docs/content/.vuepress/components/CommandInfo.vue b/docs/content/.vuepress/components/CommandInfo.vue index ed9a3090..042d1fd1 100644 --- a/docs/content/.vuepress/components/CommandInfo.vue +++ b/docs/content/.vuepress/components/CommandInfo.vue @@ -8,6 +8,7 @@ +

Syntax (how the command is used)

@@ -17,9 +18,28 @@ -

Arguments

-
- {{ key }} (textsystem ID, optional) - {{ arg.desc }}. +

Examples

+ + + + {{ part.str }} + {{ part.arg }} + + + + +

Arguments (fill in above)

+
+ {{ key }} + (textsystem + ID, optional) - {{ arg.desc }}. +
+ +

Flags (all optional, starts with a hyphen, place anywhere in the + command)

+
+ -{{ key }} + - {{ flag.desc }}