Skip to content

Commit

Permalink
feat: init suggest process
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Mar 20, 2021
1 parent f418a3c commit b478d4e
Show file tree
Hide file tree
Showing 7 changed files with 27 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/app/mod.rs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
pub mod analysis;
pub mod plugin_helper;
pub mod suggest;
pub mod visual;

pub use plugin_manager::PluginManager;
Expand Down
1 change: 1 addition & 0 deletions src/app/suggest/mod.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
pub mod suggester;
7 changes: 7 additions & 0 deletions src/app/suggest/suggester.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
pub struct Suggester;

impl Suggester {
pub fn run(_project: String) {
// let model: ModelSuggest = ModelSuggest::new(model);
}
}
11 changes: 10 additions & 1 deletion src/bin/suggest.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,18 @@
use structopt::StructOpt;

use coco::app::suggest::suggester::Suggester;
use coco::domain::SuggestOpt;
use coco::infrastructure::file_scanner;
use core_model::CocoConfig;

fn main() {
let opt: SuggestOpt = SuggestOpt::from_args();

println!("found config file: {:?}", opt);
let config_file = &opt.config_file;
let _config = CocoConfig::from_file(config_file);

let projects = file_scanner::lookup_projects();
for project in projects {
Suggester::run(project);
}
}
6 changes: 3 additions & 3 deletions src/bin/visual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,17 +12,17 @@ async fn main() -> std::io::Result<()> {
let opt: VisualOpt = VisualOpt::from_args();

if let Some(sub_cmd) = &opt.cmd {
match sub_cmd {
return match sub_cmd {
SubVisualCommand::Export { output, name } => {
let project = match name {
Some(proj) => proj.to_string(),
None => select_project_prompt(),
};

start_export_reporter(output, project.clone());
return Ok(());
Ok(())
}
}
};
}

let project = match opt.name {
Expand Down
4 changes: 4 additions & 0 deletions src/domain/cli_opt/suggest_opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,8 @@ pub struct SuggestOpt {
/// Debug mode
#[structopt(short, long, parse(try_from_str), default_value = "false")]
pub debug: bool,

/// Config file .yml
#[structopt(short, long, default_value = "coco.yml")]
pub config_file: String,
}
2 changes: 1 addition & 1 deletion src/domain/suggest/model_suggest.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,5 @@ impl ModelSuggest {
/// suggest:
/// zh-CN: 引入参数对象
/// en-US: Introduce Parameter Object
pub fn find_long_parameter_list_method() {}
pub fn find_long_parameter_list_method(&self) {}
}

0 comments on commit b478d4e

Please sign in to comment.