diff options
| author | krolxon <krolyxon@tutanota.com> | 2024-04-22 16:04:32 +0530 |
|---|---|---|
| committer | krolxon <krolyxon@tutanota.com> | 2024-04-22 16:04:32 +0530 |
| commit | a0a313996428b598e83016c97adeacd08ad42628 (patch) | |
| tree | 08f650b18d44d1bbedb2b94b60fa21174284f788 /src/cli.rs | |
| parent | 3578eae01a8d5a537cff3ad47105bc340b081fe7 (diff) | |
use subcommands instead of options
Diffstat (limited to 'src/cli.rs')
| -rwxr-xr-x | src/cli.rs | 43 |
1 files changed, 43 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs new file mode 100755 index 0000000..f1d648c --- /dev/null +++ b/src/cli.rs @@ -0,0 +1,43 @@ +use clap::{Parser, Subcommand}; +#[derive(Parser, Debug)] +#[command(version, about)] +#[clap(author = "krolyxon")] +/// MPD client made with Rust +pub struct Args { + /// pause + #[clap(short, long, default_value = "false")] + pub pause: bool, + + /// toggle pause + #[arg(short, long, default_value = "false")] + pub toggle_pause: bool, + + /// show current status + #[arg(short, long, default_value = "false")] + pub show_status: bool, + + /// use fzf selector for selecting songs + #[arg(short, long, default_value = "false")] + pub fzf_select: bool, + + /// use dmenu selector for selecting songss + #[arg(short, long, default_value = "false")] + pub dmenu_select: bool, + + #[command(subcommand)] + pub command: Command, +} + +#[derive(Debug, Subcommand)] +pub enum Command { + #[command(arg_required_else_help = true)] + Volume { + vol: String, + }, + + Dmenu, + Fzf, + Status, + Pause, + Toggle, +} |
