From 22b225e63ae5add1fad96506989f61c9c29d59e4 Mon Sep 17 00:00:00 2001 From: Jokler Date: Wed, 15 Jan 2020 19:50:18 +0100 Subject: Use structopt for command parsing (#7) --- src/command.rs | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 src/command.rs (limited to 'src/command.rs') 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 }, +} -- cgit v1.2.3-70-g09d2