Add: WIP project tasks
This commit is contained in:
parent
a6f45419a4
commit
14d47b9b93
15
src/cmd.rs
15
src/cmd.rs
@ -15,3 +15,18 @@ pub fn get_projects(config_file: &PathBuf) {
|
|||||||
let projects = String::from("we");
|
let projects = String::from("we");
|
||||||
println!("{}", projects);
|
println!("{}", projects);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub fn get_tasks(config_file: &PathBuf, project: i32) {
|
||||||
|
// Config
|
||||||
|
let mut default_config = config::Config::default();
|
||||||
|
let config = default_config.parse(&config_file);
|
||||||
|
|
||||||
|
// Call api
|
||||||
|
println!("Call API, Config: {:?}", config);
|
||||||
|
|
||||||
|
// Return json result
|
||||||
|
let tasks = String::from("tasks");
|
||||||
|
println!("{}", tasks);
|
||||||
|
|
||||||
|
println!("{}", project);
|
||||||
|
}
|
||||||
|
10
src/main.rs
10
src/main.rs
@ -26,11 +26,11 @@ fn main() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
("tasks", Some(matches)) => {
|
("tasks", Some(matches)) => {
|
||||||
let project = matches.value_of("project").unwrap_or("");
|
console::info("List of tasks");
|
||||||
println!("Tasks");
|
let project = matches.value_of("project")
|
||||||
if !project.is_empty() {
|
.unwrap_or("0").trim().parse()
|
||||||
println!("Project: {}", project);
|
.expect("Type a number!");
|
||||||
}
|
cmd::get_tasks(&config_file, project);
|
||||||
}
|
}
|
||||||
|
|
||||||
_ => console::error("Whut!!!"),
|
_ => console::error("Whut!!!"),
|
||||||
|
Loading…
Reference in New Issue
Block a user