timetrack works locally
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
use clap::ArgMatches;
|
||||
use marts::CliPart;
|
||||
use core::result::Result::Err;
|
||||
use core::unimplemented;
|
||||
use mize::flume::bounded;
|
||||
@@ -66,20 +67,22 @@ pub fn info(sub_matches: &ArgMatches, instance: &mut Mize) -> MizeResult<()> {
|
||||
Err(mize_err!("not implemented"))
|
||||
}
|
||||
|
||||
pub fn run(sub_matches: &ArgMatches, instance: &mut Mize) -> MizeResult<()> {
|
||||
pub fn run(sub_matches: &ArgMatches, mize: &mut Mize) -> MizeResult<()> {
|
||||
match sub_matches.subcommand() {
|
||||
None => {
|
||||
instance.wait();
|
||||
None => { // run a mize instance (does whatever it's config will say)
|
||||
mize.wait();
|
||||
}
|
||||
Some((runnable, sub_matches)) => {
|
||||
let ext_args: Vec<String> = sub_matches
|
||||
Some((runnable, sub_matches)) => { // run smth from a part. for now registered cli commands
|
||||
let mut ext_args: Vec<String> = sub_matches
|
||||
.get_many::<OsString>("")
|
||||
.unwrap_or_default()
|
||||
.map(|v| v.to_string_lossy().to_string())
|
||||
.collect();
|
||||
let mut ext_cmdline = vec![runnable.to_owned()];
|
||||
ext_cmdline.append(&mut ext_args);
|
||||
|
||||
println!("runnable: {}", runnable);
|
||||
println!("args: {:?}", ext_args);
|
||||
let mut cli = mize.get_part_native::<CliPart>("cli")?;
|
||||
cli.run(ext_cmdline)?;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user