mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-06 13:57:54 +00:00
refactor(command_parser): simplify how tokens are defined in commands
This commit is contained in:
parent
f804e7629f
commit
071db3d6d6
9 changed files with 114 additions and 76 deletions
|
|
@ -1,13 +1,13 @@
|
|||
use super::*;
|
||||
|
||||
pub fn cmds() -> impl Iterator<Item = Command> {
|
||||
let system = ["system", "s"];
|
||||
let new = ["new", "n"];
|
||||
let system = ("system", ["s"]);
|
||||
let new = ("new", ["n"]);
|
||||
|
||||
let system_new = tokens!(system, new);
|
||||
|
||||
[
|
||||
command!([system] => "system_show").help("Shows information about your system"),
|
||||
command!(system => "system_show").help("Shows information about your system"),
|
||||
command!(system_new => "system_new").help("Creates a new system"),
|
||||
command!(system_new, ("name", OpaqueString) => "system_new_name")
|
||||
.help("Creates a new system (using the provided name)"),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue