aboutsummaryrefslogtreecommitdiff
path: root/src/framework/standard/create_group.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/framework/standard/create_group.rs')
-rw-r--r--src/framework/standard/create_group.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/src/framework/standard/create_group.rs b/src/framework/standard/create_group.rs
index 0049cf3..fb196b1 100644
--- a/src/framework/standard/create_group.rs
+++ b/src/framework/standard/create_group.rs
@@ -97,6 +97,24 @@ impl CreateGroup {
pub fn cmd<C: Command + 'static>(mut self, name: &str, c: C) -> Self {
let cmd: Arc<Command> = Arc::new(c);
+ for n in &cmd.options().aliases {
+
+ if let Some(ref prefixes) = self.0.prefixes {
+
+ for prefix in prefixes {
+ self.0.commands.insert(
+ format!("{} {}", prefix, n.to_string()),
+ CommandOrAlias::Alias(format!("{} {}", prefix, name.to_string())),
+ );
+ }
+ } else {
+ self.0.commands.insert(
+ n.to_string(),
+ CommandOrAlias::Alias(name.to_string()),
+ );
+ }
+ }
+
self.0
.commands
.insert(name.to_string(), CommandOrAlias::Command(Arc::clone(&cmd)));