| 1 | use clap::{Parser, Subcommand}; |
| 2 | |
| 3 | #[derive(Parser, Debug)] |
| 4 | #[clap(version, about, author = "krolyxon")] |
| 5 | /// MPD client made with Rust |
| 6 | pub struct Args { |
| 7 | /// No TUI |
| 8 | #[arg(short= 'n', default_value="false")] |
| 9 | pub no_tui: bool, |
| 10 | |
| 11 | #[command(subcommand)] |
| 12 | pub command: Command, |
| 13 | } |
| 14 | |
| 15 | #[derive(Debug, Subcommand)] |
| 16 | pub enum Command { |
| 17 | #[command(arg_required_else_help = true, long_flag = "volume" , short_flag = 'v')] |
| 18 | /// Set Volume |
| 19 | Volume { |
| 20 | vol: String, |
| 21 | }, |
| 22 | |
| 23 | /// Use dmenu for selection |
| 24 | #[command(long_flag = "dmenu" , short_flag = 'd')] |
| 25 | Dmenu, |
| 26 | |
| 27 | /// Use Fzf for selection |
| 28 | #[command(long_flag = "fzf" , short_flag = 'f')] |
| 29 | Fzf, |
| 30 | |
| 31 | /// Check Status |
| 32 | #[command(long_flag = "status" , short_flag = 's')] |
| 33 | Status, |
| 34 | |
| 35 | /// Pause playback |
| 36 | #[command(long_flag = "pause" , short_flag = 'p')] |
| 37 | Pause, |
| 38 | |
| 39 | /// Toggle Playback |
| 40 | #[command(long_flag = "toggle" , short_flag = 't')] |
| 41 | Toggle, |
| 42 | |
| 43 | } |