Skip to content

Commit

Permalink
fix: fix visual opt issue
Browse files Browse the repository at this point in the history
  • Loading branch information
phodal committed Mar 12, 2021
1 parent b940186 commit a3a9f24
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 6 deletions.
17 changes: 11 additions & 6 deletions src/bin/visual.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,20 +11,25 @@ use coco::infrastructure::file_scanner;
async fn main() -> std::io::Result<()> {
let opt: VisualOpt = VisualOpt::from_args();

let project = match opt.name {
Some(proj) => proj.to_string(),
None => select_project_prompt(),
};

if let Some(sub_cmd) = &opt.cmd {
match sub_cmd {
SubVisualCommand::Export { output } => {
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(());
}
}
}

let project = match opt.name {
Some(proj) => proj.to_string(),
None => select_project_prompt(),
};

return start_local_server(project, opt.port.as_str()).await;
}

Expand Down
3 changes: 3 additions & 0 deletions src/domain/cli_opt/visual_opt.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,5 +25,8 @@ pub enum SubVisualCommand {
/// output path
#[structopt(long, short, parse(try_from_str), default_value = "coco_static")]
output: String,

#[structopt(long, short, parse(try_from_str))]
name: Option<String>,
},
}

0 comments on commit a3a9f24

Please sign in to comment.