aboutsummaryrefslogtreecommitdiff
path: root/src/cli.rs
blob: 2992952d522b23e316a92be35b505335ad06b4d2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
use clap::{Parser, Subcommand};

#[derive(Parser, Debug)]
#[clap(version, about, author = "krolyxon")]
/// MPD client made with Rust
pub struct Args {
    /// No TUI
    #[arg(short= 'n', default_value="false")]
    pub tui: bool,

    #[command(subcommand)]
    pub command: Option<Command>,
}

#[derive(Debug, Subcommand)]
pub enum Command {
    #[command(arg_required_else_help = true, long_flag = "volume" , short_flag = 'v')]
    /// Set Volume
    Volume {
        vol: String,
    },

    /// Use dmenu for selection
    #[command(long_flag = "dmenu" , short_flag = 'd')]
    Dmenu,

    /// Use Fzf for selection
    #[command(long_flag = "fzf" , short_flag = 'f')]
    Fzf,

    /// Check Status
    #[command(long_flag = "status" , short_flag = 's')]
    Status,

    /// Pause playback
    #[command(long_flag = "pause" , short_flag = 'p')]
    Pause,

    /// Toggle Playback
    #[command(long_flag = "toggle" , short_flag = 't')]
    Toggle,

}