Skip to content

Commit 6258125

Browse files
committed
renamed owner arg to user & started adding user command
1 parent 77528ba commit 6258125

1 file changed

Lines changed: 36 additions & 13 deletions

File tree

src/main.rs

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -8,18 +8,17 @@ use crate::commands::releases::releases_command;
88
use crate::utils::validate_and_convert_path;
99

1010
fn main() {
11-
//TODO: command to show info about a user
1211
let cli = Cli::new().with_default_command("help").with_commands(vec![
1312
Command::new("version", "Displays the current version of github-stats").with_short('v'),
1413
Command::new("install", "Installs the files and directories"),
1514
Command::new("all", "Gives all stats found on a repository as json")
1615
.with_arg(
1716
Arg::new()
18-
.with_name("owner")
19-
.with_short('o')
20-
.with_long("owner")
21-
.with_value_name("OWNER")
22-
.with_help("Owner of the repository"),
17+
.with_name("user")
18+
.with_short('u')
19+
.with_long("user")
20+
.with_value_name("USER")
21+
.with_help("The user who owns the repository"),
2322
)
2423
.with_arg(
2524
Arg::new()
@@ -32,7 +31,7 @@ fn main() {
3231
.with_arg(
3332
Arg::new()
3433
.with_name("output")
35-
.with_short('f')
34+
.with_short('o')
3635
.with_long("output")
3736
.with_value_name("OUTPUT")
3837
.with_help("File path to save the json"),
@@ -47,11 +46,11 @@ fn main() {
4746
Command::new("releases", "Gives information on github releases")
4847
.with_arg(
4948
Arg::new()
50-
.with_name("owner")
51-
.with_short('o')
52-
.with_long("owner")
53-
.with_value_name("OWNER")
54-
.with_help("Owner of the repository"),
49+
.with_name("user")
50+
.with_short('u')
51+
.with_long("user")
52+
.with_value_name("USER")
53+
.with_help("The user who owns the repository"),
5554
)
5655
.with_arg(
5756
Arg::new()
@@ -78,7 +77,7 @@ fn main() {
7877
.with_arg(
7978
Arg::new()
8079
.with_name("output")
81-
.with_short('f')
80+
.with_short('o')
8281
.with_long("output")
8382
.with_value_name("OUTPUT")
8483
.with_help("File path to save the json"),
@@ -97,6 +96,30 @@ fn main() {
9796
.with_long("display")
9897
.with_help("Converts the json to an easier format (will remove some data)."),
9998
),
99+
Command::new("user", "Gives information about a github user")
100+
.with_arg(
101+
Arg::new()
102+
.with_name("user")
103+
.with_short('u')
104+
.with_long("user")
105+
.with_value_name("USER")
106+
.with_help("The user you want information on"),
107+
)
108+
.with_arg(
109+
Arg::new()
110+
.with_name("output")
111+
.with_short('o')
112+
.with_long("output")
113+
.with_value_name("OUTPUT")
114+
.with_help("File path to save the json"),
115+
)
116+
.with_arg(
117+
Arg::new()
118+
.with_name("display")
119+
.with_short('d')
120+
.with_long("display")
121+
.with_help("Converts the json to an easier format (will remove some data)."),
122+
),
100123
Command::new("help", "Helps you with the commands").with_short('h'),
101124
]);
102125

0 commit comments

Comments
 (0)