discordrpc/src/cli.rs

144 lines
3.0 KiB
Rust
Raw Normal View History

2022-02-12 21:59:16 +00:00
use clap::Parser;
2022-02-13 17:32:17 +00:00
use clap_complete::Shell;
2022-02-12 21:59:16 +00:00
2022-03-09 17:23:26 +00:00
#[derive(Debug, Parser, Clone)]
2022-02-12 21:59:16 +00:00
#[clap(name = "discordrpc")]
pub struct Cli {
#[clap(
short = 'c',
2022-02-13 12:03:22 +00:00
long = "client-id",
2022-02-12 21:59:16 +00:00
help = "Discord application Client ID",
required = true,
display_order = 1
)]
pub client_id: String,
#[clap(
short = 'd',
2022-02-13 12:03:22 +00:00
long = "details",
2022-02-12 21:59:16 +00:00
help = "Details",
2022-02-13 12:03:22 +00:00
required = true,
display_order = 2
2022-02-12 21:59:16 +00:00
)]
pub details: String,
2022-02-13 12:03:22 +00:00
#[clap(
short = 's',
long = "state",
help = "State",
required = false,
default_value = "none",
display_order = 3
)]
pub state: String,
2022-02-12 21:59:16 +00:00
#[clap(
short = 'I',
2022-02-13 12:03:22 +00:00
long = "large-image",
2022-02-12 21:59:16 +00:00
help = "Large Image name",
default_value = "none",
2022-02-13 12:03:22 +00:00
required = false,
display_order = 4
2022-02-12 21:59:16 +00:00
)]
pub large_image: String,
#[clap(
short = 'T',
2022-02-13 12:03:22 +00:00
long = "large-image-text",
2022-02-12 21:59:16 +00:00
help = "Large Image text",
default_value = "none",
2022-02-13 12:03:22 +00:00
required = false,
display_order = 5
2022-02-12 21:59:16 +00:00
)]
pub large_text: String,
#[clap(
short = 'i',
2022-02-13 12:03:22 +00:00
long = "small-image",
2022-02-12 21:59:16 +00:00
help = "Small Image name",
default_value = "none",
2022-02-13 12:03:22 +00:00
required = false,
display_order = 6
2022-02-12 21:59:16 +00:00
)]
pub small_image: String,
#[clap(
short = 't',
2022-02-13 12:03:22 +00:00
long = "small-image-text",
2022-02-12 21:59:16 +00:00
help = "Small Image text",
default_value = "none",
2022-02-13 12:03:22 +00:00
required = false,
display_order = 7
2022-02-12 21:59:16 +00:00
)]
pub small_text: String,
2022-02-13 12:03:22 +00:00
#[clap(
short = 'B',
long = "button-1-text",
help = "Button 1 Text",
default_value = "none",
required = false,
display_order = 8
)]
pub button_1_text: String,
#[clap(
short = 'U',
2022-02-13 12:03:22 +00:00
long = "button-1-url",
help = "Button 1 URL address",
default_value = "none",
required = false,
display_order = 9
)]
pub button_1_url: String,
#[clap(
short = 'b',
long = "button-2-text",
help = "Button 2 Text",
default_value = "none",
required = false,
display_order = 10
)]
pub button_2_text: String,
#[clap(
short = 'u',
2022-02-13 12:03:22 +00:00
long = "button-2-url",
help = "Button 2 URL address",
default_value = "none",
required = false,
display_order = 11
)]
pub button_2_url: String,
#[clap(
short = 'e',
long = "timer",
help = "Enable timer (counted from the current time)",
display_order = 12
)]
pub enable_time: bool,
2022-02-13 17:32:17 +00:00
2022-03-09 17:23:26 +00:00
#[clap(
short = 'E',
long = "timeout",
help = "Exit after X seconds",
2022-03-09 17:50:19 +00:00
default_value = "0",
2022-03-09 17:23:26 +00:00
required = false,
display_order = 13
)]
pub timeout: u64,
2022-02-13 17:32:35 +00:00
#[clap(
long = "print-completions",
value_name = "shell",
arg_enum,
2022-03-09 17:23:26 +00:00
display_order = 14
2022-02-13 17:32:35 +00:00
)]
2022-02-13 17:32:17 +00:00
pub print_completions: Option<Shell>,
2022-03-09 17:39:33 +00:00
2022-03-09 17:50:19 +00:00
#[clap(long = "print-manpage", display_order = 15)]
2022-03-09 17:39:33 +00:00
pub manpage: bool,
2022-02-12 21:59:16 +00:00
}