Skip to content

Commit

Permalink
feat(client): setting depth in cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
williamfzc committed Mar 21, 2024
1 parent 436ccfa commit da5625d
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/collector/config.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ impl CommitResult {
#[derive(Deserialize, Serialize, Debug)]
pub struct Config {
pub repo_path: String,
pub depth: i32,
pub depth: u32,
pub issue_regex: String,
pub path_specs: Vec<String>,
pub multi_parents: bool,
Expand Down
10 changes: 10 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,10 @@ struct CommonOptions {
/// Show progress
#[clap(long)]
progress: Option<bool>,

/// Depth Limit
#[clap(long)]
depth: Option<u32>,
}

#[derive(Parser, Debug)]
Expand Down Expand Up @@ -93,6 +97,9 @@ fn handle_map(map_command: MapCommand) {
if let Some(ref multi_parents) = map_command.common_options.multi_parents {
conf.multi_parents = multi_parents.clone()
}
if let Some(ref depth) = map_command.common_options.depth {
conf.depth = depth.clone()
}

info!("config: {:?}", map_command);
let start_time = Instant::now();
Expand Down Expand Up @@ -132,6 +139,9 @@ fn handle_up(up_cmd: UpCommand) {
if let Some(ref progress) = up_cmd.common_options.progress {
conf.progress = progress.clone()
}
if let Some(ref depth) = up_cmd.common_options.depth {
conf.depth = depth.clone()
}

info!("config: {:?}", up_cmd);
let start_time = Instant::now();
Expand Down
1 change: 0 additions & 1 deletion src/server/handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ async fn issues() -> axum::Json<Vec<String>> {
return axum::Json(conf.graph.issues());
}


async fn commit_related_files_handler(
Query(params): Query<CommitParams>,
) -> axum::Json<Vec<String>> {
Expand Down

0 comments on commit da5625d

Please sign in to comment.