Skip to content

Commit 8b654b4

Browse files
authored
a small code revamp
1 parent 715589d commit 8b654b4

2 files changed

Lines changed: 156 additions & 287 deletions

File tree

src/cli.rs

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
use clap::Parser;
2+
3+
#[derive(Parser)]
4+
pub(crate) struct Cli {
5+
#[clap(short = 'c', long = "clientid",help = "Your application's client id (REQUIRED)" ,required = true,display_order = 1)]
6+
pub clientid: String,
7+
8+
#[clap(short = 'd', long = "details",help = "Your desired details string (optional)",required = false,default_value="__None",display_order=2)]
9+
pub details: String,
10+
11+
#[clap(short = 's', long = "state",help = "Your desired state string (optional)" ,required = false,default_value="__None",display_order=3)]
12+
pub state: String,
13+
14+
#[clap(short = 'N', long = "large_image",help = "The name of your large image (optional)",required = false,default_value="__None",display_order=4)]
15+
pub large_image: String,
16+
17+
#[clap(short = 'I', long = "large_image_text",help = "The text shown on your large image (optional)",required = false,default_value="__None",display_order=5)]
18+
pub large_text: String,
19+
20+
#[clap(short = 'n', long = "small_image",help = "The name of your small image (optional)",required = false,default_value="__None",display_order=6)]
21+
pub small_image: String,
22+
23+
#[clap(short = 'i', long = "small_image_text",help = "The text shown on your small image (optional)",required = false,default_value="__None",display_order=7)]
24+
pub small_text: String,
25+
26+
#[clap(short = 'U', long = "button_url_1",help = "The url of your first button (optional)",required = false,default_value="__None",display_order=8)]
27+
pub button_url_1: String,
28+
29+
#[clap(short = 'B', long = "button_text_1",help = "The text shown on your first button (optional)",required = false,default_value="__None",display_order=9)]
30+
pub button_text_1: String,
31+
32+
#[clap(short = 'u', long = "button_url_2",help = "The url of your second button (optional)",required = false,default_value="__None",display_order=10)]
33+
pub button_url_2: String,
34+
35+
#[clap(short = 'b', long = "button_text_2",help = "The text shown on your second button (optional)",required = false,default_value="__None",display_order=11)]
36+
pub button_text_2: String,
37+
38+
#[clap(short = 'S', long = "start_time",help = "Set the start time (Unix time) (optional)",default_value="-1",display_order=12)]
39+
pub start_time: i64,
40+
41+
#[clap(short = 'E', long = "end_time",help = "Set the end time (Unix time) (optional)",default_value="-1",display_order=13)]
42+
pub end_time: i64,
43+
44+
#[clap(short = 'P', long = "party_size",help = "Creates a party with a current size of _ and a max size of _ (Example: [1,10]) (optional)",default_value="__None",display_order=14)]
45+
pub party_size: String,
46+
47+
#[clap(short = 'p', long = "party_id",help = "Sets the ID of the party (Has to be used with party_size) (optional)",default_value="__None",display_order=15)]
48+
pub party_id: String,
49+
50+
#[clap(short = 'm', long = "match_id",help = "Sets the ID of the match (Can't be used with buttons) (optional)",default_value="__None",display_order=16)]
51+
pub match_id: String,
52+
53+
#[clap(short = 'j', long = "join_id",help = "Sets the join ID of the match (Has to be used with match_id) (optional)",default_value="__None",display_order=17)]
54+
pub join_id: String,
55+
56+
#[clap(short = 'y', long = "spectate_id",help = "Sets the spectate ID of the match (Has to be used with match_id) (optional)",default_value="__None",display_order=18)]
57+
pub spectate_id: String,
58+
59+
#[clap(short = 't', long = "enable_time",help = "Whether to enable time or not (will count from current time) (optional)",display_order=19)]
60+
pub enable_time: bool,
61+
62+
#[clap(short = 'e', long = "exit_after",help = "Exit after a given time (optional)",default_value="-1",display_order=20)]
63+
pub exit_after: i64,
64+
65+
#[clap(short = 'C', long = "disable_color",help = "Whether to disable colors or not (optional)",display_order=21)]
66+
pub disable_color: bool,
67+
}

0 commit comments

Comments
 (0)