summaryrefslogtreecommitdiffstats
path: root/src/command.rs
diff options
context:
space:
mode:
authorJokler <jokler@protonmail.com>2020-01-15 19:50:18 +0100
committerGitHub <noreply@github.com>2020-01-15 19:50:18 +0100
commit22b225e63ae5add1fad96506989f61c9c29d59e4 (patch)
tree40a7cab36fb395ef191df42c33bcdebf45d2ea6e /src/command.rs
parent7e3ef6868ec138992ca22e96539acf385afb8a1c (diff)
downloadpokebot-22b225e63ae5add1fad96506989f61c9c29d59e4.tar.gz
pokebot-22b225e63ae5add1fad96506989f61c9c29d59e4.zip
Use structopt for command parsing (#7)
Diffstat (limited to 'src/command.rs')
-rw-r--r--src/command.rs25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/command.rs b/src/command.rs
new file mode 100644
index 0000000..283a47e
--- /dev/null
+++ b/src/command.rs
@@ -0,0 +1,25 @@
+use structopt::clap::AppSettings::*;
+use structopt::StructOpt;
+
+#[derive(StructOpt, Debug)]
+#[structopt(
+ rename_all = "kebab-case",
+ template = "Try one of these commands:\n{subcommands}",
+ raw(global_settings = "&[VersionlessSubcommands, ColorNever]",)
+)]
+pub enum Command {
+ /// Adds url to playlist
+ Add { url: String },
+ /// Starts audio playback
+ Play,
+ /// Pauses audio playback
+ Pause,
+ /// Stops audio playback
+ Stop,
+ /// Switches to the next queue entry
+ Next,
+ /// Clears the playback queue
+ Clear,
+ /// Changes the volume to the specified value
+ Volume { percent: f64 },
+}