From bdf44c32ffc12e4571c859a52ba4c64044123691 Mon Sep 17 00:00:00 2001 From: Dragory <2606411+Dragory@users.noreply.github.com> Date: Fri, 25 Oct 2019 20:25:25 +0300 Subject: [PATCH] Recommend -option instead of --option Since knub-command-manager accepts both -option and --option now, this change should make options more intuitive to use. Both syntaxes are still supported and neither is getting deprecated for now. --- dashboard/src/components/docs/Plugin.vue | 2 +- src/plugins/ChannelArchiver.ts | 2 +- src/plugins/ModActions.ts | 42 ++++++++++++------------ src/plugins/Post.ts | 8 ++--- 4 files changed, 27 insertions(+), 27 deletions(-) diff --git a/dashboard/src/components/docs/Plugin.vue b/dashboard/src/components/docs/Plugin.vue index 3c7008e5..a6900e2d 100644 --- a/dashboard/src/components/docs/Plugin.vue +++ b/dashboard/src/components/docs/Plugin.vue @@ -169,7 +169,7 @@ } }, renderOption(opt) { - let str = `--${opt.name}`; + let str = `-${opt.name}`; if (opt.shortcut) { str += `|-${opt.shortcut}`; } diff --git a/src/plugins/ChannelArchiver.ts b/src/plugins/ChannelArchiver.ts index 421604af..f909ff37 100644 --- a/src/plugins/ChannelArchiver.ts +++ b/src/plugins/ChannelArchiver.ts @@ -73,7 +73,7 @@ export class ChannelArchiverPlugin extends ZeppelinPlugin { this.bot, msg.channel, msg.author.id, - "No `--attachment-channel` specified. Continue? Attachments will not be available in the log if their message is deleted.", + "No `-attachment-channel` specified. Continue? Attachments will not be available in the log if their message is deleted.", ); if (!confirmed) { msg.channel.createMessage(errorMessage("Canceled")); diff --git a/src/plugins/ModActions.ts b/src/plugins/ModActions.ts index a99701fe..c904b2c4 100644 --- a/src/plugins/ModActions.ts +++ b/src/plugins/ModActions.ts @@ -592,11 +592,11 @@ export class ModActionsPlugin extends ZeppelinPlugin { return; } - // The moderator who did the action is the message author or, if used, the specified --mod + // The moderator who did the action is the message author or, if used, the specified -mod let mod = msg.member; if (args.mod) { if (!this.hasPermission("can_act_as_other", { message: msg })) { - msg.channel.createMessage(errorMessage("No permission for --mod")); + msg.channel.createMessage(errorMessage("No permission for -mod")); return; } @@ -694,13 +694,13 @@ export class ModActionsPlugin extends ZeppelinPlugin { * The only difference between the two commands is in target member validation. */ async actualMuteCmd(user: User | UnknownUser, msg: Message, args: { time?: number; reason?: string; mod: Member }) { - // The moderator who did the action is the message author or, if used, the specified --mod + // The moderator who did the action is the message author or, if used, the specified -mod let mod = msg.member; let pp = null; if (args.mod) { if (!this.hasPermission("can_act_as_other", { message: msg })) { - msg.channel.createMessage(errorMessage("No permission for --mod")); + msg.channel.createMessage(errorMessage("No permission for -mod")); return; } @@ -839,13 +839,13 @@ export class ModActionsPlugin extends ZeppelinPlugin { msg: Message, args: { time?: number; reason?: string; mod?: Member }, ) { - // The moderator who did the action is the message author or, if used, the specified --mod + // The moderator who did the action is the message author or, if used, the specified -mod let mod = msg.author; let pp = null; if (args.mod) { if (!this.hasPermission("can_act_as_other", { message: msg })) { - this.sendErrorMessage(msg.channel, "No permission for --mod"); + this.sendErrorMessage(msg.channel, "No permission for -mod"); return; } @@ -996,11 +996,11 @@ export class ModActionsPlugin extends ZeppelinPlugin { return; } - // The moderator who did the action is the message author or, if used, the specified --mod + // The moderator who did the action is the message author or, if used, the specified -mod let mod = msg.member; if (args.mod) { if (!this.hasPermission("can_act_as_other", { message: msg })) { - this.sendErrorMessage(msg.channel, "No permission for --mod"); + this.sendErrorMessage(msg.channel, "No permission for -mod"); return; } @@ -1059,11 +1059,11 @@ export class ModActionsPlugin extends ZeppelinPlugin { return; } - // The moderator who did the action is the message author or, if used, the specified --mod + // The moderator who did the action is the message author or, if used, the specified -mod let mod = msg.member; if (args.mod) { if (!this.hasPermission("can_act_as_other", { message: msg })) { - this.sendErrorMessage(msg.channel, "No permission for --mod"); + this.sendErrorMessage(msg.channel, "No permission for -mod"); return; } @@ -1123,11 +1123,11 @@ export class ModActionsPlugin extends ZeppelinPlugin { return; } - // The moderator who did the action is the message author or, if used, the specified --mod + // The moderator who did the action is the message author or, if used, the specified -mod let mod = msg.member; if (args.mod) { if (!this.hasPermission("can_act_as_other", { message: msg })) { - this.sendErrorMessage(msg.channel, "No permission for --mod"); + this.sendErrorMessage(msg.channel, "No permission for -mod"); return; } @@ -1195,11 +1195,11 @@ export class ModActionsPlugin extends ZeppelinPlugin { const user = await this.resolveUser(args.user); if (!user) return this.sendErrorMessage(msg.channel, `User not found`); - // The moderator who did the action is the message author or, if used, the specified --mod + // The moderator who did the action is the message author or, if used, the specified -mod let mod = msg.member; if (args.mod) { if (!this.hasPermission("can_act_as_other", { message: msg })) { - this.sendErrorMessage(msg.channel, "No permission for --mod"); + this.sendErrorMessage(msg.channel, "No permission for -mod"); return; } @@ -1265,11 +1265,11 @@ export class ModActionsPlugin extends ZeppelinPlugin { return; } - // The moderator who did the action is the message author or, if used, the specified --mod + // The moderator who did the action is the message author or, if used, the specified -mod let mod = msg.member; if (args.mod) { if (!this.hasPermission("can_act_as_other", { message: msg })) { - this.sendErrorMessage(msg.channel, "No permission for --mod"); + this.sendErrorMessage(msg.channel, "No permission for -mod"); return; } @@ -1416,11 +1416,11 @@ export class ModActionsPlugin extends ZeppelinPlugin { return; } - // The moderator who did the action is the message author or, if used, the specified --mod + // The moderator who did the action is the message author or, if used, the specified -mod let mod = msg.member; if (args.mod) { if (!this.hasPermission("can_act_as_other", { message: msg })) { - this.sendErrorMessage(msg.channel, "No permission for --mod"); + this.sendErrorMessage(msg.channel, "No permission for -mod"); return; } @@ -1545,9 +1545,9 @@ export class ModActionsPlugin extends ZeppelinPlugin { if (!args.hidden && hiddenCases.length) { if (hiddenCases.length === 1) { - lines.push(`*+${hiddenCases.length} hidden case, use "--hidden" to show it*`); + lines.push(`*+${hiddenCases.length} hidden case, use "-hidden" to show it*`); } else { - lines.push(`*+${hiddenCases.length} hidden cases, use "--hidden" to show them*`); + lines.push(`*+${hiddenCases.length} hidden cases, use "-hidden" to show them*`); } } @@ -1568,7 +1568,7 @@ export class ModActionsPlugin extends ZeppelinPlugin { options: [{ name: "mod", type: "Member" }], extra: { info: { - description: "Show the most recent 5 cases by the specified --mod", + description: "Show the most recent 5 cases by the specified -mod", }, }, }) diff --git a/src/plugins/Post.ts b/src/plugins/Post.ts index b949bb62..de965c36 100644 --- a/src/plugins/Post.ts +++ b/src/plugins/Post.ts @@ -365,8 +365,8 @@ export class PostPlugin extends ZeppelinPlugin { msg.channel.createMessage( trimLines(` <@!${msg.author.id}> You can now specify an embed's content directly at the end of the command: - \`${prefix}post_embed --title="Some title" content goes here\` - The \`--content\` option will soon be removed in favor of this. + \`${prefix}post_embed -title "Some title" content goes here\` + The \`-content\` option will soon be removed in favor of this. `), ); } @@ -440,8 +440,8 @@ export class PostPlugin extends ZeppelinPlugin { msg.channel.createMessage( trimLines(` <@!${msg.author.id}> You can now specify an embed's content directly at the end of the command: - \`${prefix}edit_embed --title="Some title" content goes here\` - The \`--content\` option will soon be removed in favor of this. + \`${prefix}edit_embed -title "Some title" content goes here\` + The \`-content\` option will soon be removed in favor of this. `), ); }