diff options
| author | Jokler <jokler@protonmail.com> | 2020-01-15 19:50:18 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-01-15 19:50:18 +0100 |
| commit | 22b225e63ae5add1fad96506989f61c9c29d59e4 (patch) | |
| tree | 40a7cab36fb395ef191df42c33bcdebf45d2ea6e /src/command.rs | |
| parent | 7e3ef6868ec138992ca22e96539acf385afb8a1c (diff) | |
| download | pokebot-22b225e63ae5add1fad96506989f61c9c29d59e4.tar.gz pokebot-22b225e63ae5add1fad96506989f61c9c29d59e4.zip | |
Use structopt for command parsing (#7)
Diffstat (limited to 'src/command.rs')
| -rw-r--r-- | src/command.rs | 25 |
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 }, +} |
