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
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
use clap::{Parser, Subcommand};
#[derive(Parser)]
#[command(name = "acr", about = "AtCoder CLI tool for Rust", version)]
pub struct Cli {
#[command(subcommand)]
pub command: Command,
}
#[derive(Subcommand)]
pub enum Command {
/// Initial setup (interactive)
Init,
/// Login to AtCoder
Login,
/// Logout from AtCoder
Logout,
/// Check login status
Session,
/// Create contest workspace and open editor
#[command(alias = "n")]
New {
/// Contest ID (e.g. abc001)
contest_id: String,
},
/// Add a problem to the contest workspace
Add {
/// Problem identifier (e.g. a, b, c)
problem: String,
},
/// Fetch or re-fetch sample test cases
Fetch {
/// Problem identifier (e.g. a, b, c)
problem: Option<String>,
},
/// Open problem page in browser
///
/// From a problem directory: opens the problem page.
///
/// From a contest directory: opens the task list,
/// or a specific problem with PROBLEM arg.
#[command(alias = "v")]
View {
/// Problem identifier (e.g. a, b, c)
problem: Option<String>,
},
/// Run tests for the current problem
#[command(alias = "t")]
Test {
/// Problem identifier (e.g. a, b, c)
problem: Option<String>,
},
/// Test and submit the current problem
#[command(alias = "s")]
Submit {
/// Problem identifier (e.g. a, b, c)
problem: Option<String>,
/// Submit even if tests fail
#[arg(short, long)]
force: bool,
},
/// Open my submissions page in browser
Submissions,
/// View or modify configuration
Config {
/// Configuration key
key: Option<String>,
/// Configuration value
value: Option<String>,
},
}