Skip to content

Commit 73fd494

Browse files
committed
renamed all_command to repo_command
1 parent fd6e374 commit 73fd494

4 files changed

Lines changed: 9 additions & 8 deletions

File tree

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -53,8 +53,8 @@ COMMANDS:
5353
Displays the current version of github-stats
5454
install -
5555
Installs the files and directories
56-
all -
57-
Gives all stats found on a repository as json
56+
repo -
57+
Gives general information about a repository
5858
-u --user <USER> The user who owns the repository
5959
-r --repository <REPOSITORY> Name of the repository
6060
-o --output <OUTPUT> File path to save the json
@@ -86,6 +86,7 @@ COMMANDS:
8686
-o --output <OUTPUT> File path to save the json
8787
-d --display <> Converts the json to an easier format (will remove some data)
8888
help -h
89+
Helps you with the commands
8990
```
9091

9192
## Contributing

src/commands/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
pub mod all;
1+
pub mod repo;
22
pub mod releases;
33
pub mod user;
44
pub mod relations;
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::utils::{pretty_dates, request, write_to_file};
22
use serde_json::Value;
33
use std::path::PathBuf;
44

5-
pub fn all_command(owner: String, repo: String, output: Option<PathBuf>, display: bool) {
5+
pub fn repo_command(owner: String, repo: String, output: Option<PathBuf>, display: bool) {
66
let url = format!("https://api.github.com/repos/{}/{}", owner, repo);
77

88
let json = request(url).expect("Failed to request data");

src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ pub mod commands;
33
pub mod utils;
44

55
use crate::cli::{Arg, Cli, Command};
6-
use crate::commands::all::all_command;
6+
use crate::commands::repo::repo_command;
77
use crate::commands::relations::{relations_command, RelationType};
88
use crate::commands::releases::releases_command;
99
use crate::commands::user::user_command;
@@ -13,7 +13,7 @@ fn main() {
1313
let cli = Cli::new().with_default_command("help").with_commands(vec![
1414
Command::new("version", "Displays the current version of github-stats").with_short('v'),
1515
Command::new("install", "Installs the files and directories"),
16-
Command::new("all", "Gives all stats found on a repository as json")
16+
Command::new("repo", "Gives general information about a repository")
1717
.with_arg(
1818
Arg::new()
1919
.with_name("user")
@@ -202,15 +202,15 @@ fn main() {
202202

203203
install(&os);
204204
}
205-
"all" => {
205+
"repo" => {
206206
let user = command.get_value_of("user").throw_if_none();
207207
let repo = command.get_value_of("repository").throw_if_none();
208208
let output = command.get_value_of("output").to_option();
209209
let display = command.has("display");
210210

211211
let output = output_to_path(output);
212212

213-
all_command(user, repo, output, display);
213+
repo_command(user, repo, output, display);
214214
}
215215
"releases" => {
216216
let user = command.get_value_of("user").throw_if_none();

0 commit comments

Comments
 (0)