updated README and a bunch of other stuff
This commit is contained in:
@@ -26,21 +26,16 @@ pub fn get(sub_matches: &ArgMatches, instance: &mut Mize) -> MizeResult<()> {
|
||||
.get_one::<String>("id")
|
||||
.ok_or(MizeError::new().msg("No id Argument specified"))?;
|
||||
|
||||
let item = instance.get(id)?;
|
||||
let raw = sub_matches.get_flag("raw");
|
||||
let data = instance.get_config(id)?;
|
||||
|
||||
let recurse_count = sub_matches.get_count("recurse");
|
||||
|
||||
println!("{}", item.as_data_full()?);
|
||||
return Ok(());
|
||||
|
||||
if recurse_count > 0 {
|
||||
println!("{}", item.id());
|
||||
println!("{}", item.as_data_full()?);
|
||||
if raw {
|
||||
print!("{}", data.value_string()?);
|
||||
} else {
|
||||
println!("{}", item);
|
||||
};
|
||||
println!("{}", data);
|
||||
}
|
||||
|
||||
return Ok(());
|
||||
Ok(())
|
||||
}
|
||||
|
||||
pub fn call(sub_matches: &ArgMatches, instance: &mut Mize) -> MizeResult<()> {
|
||||
|
||||
@@ -147,7 +147,13 @@ fn cli_matches() -> clap::ArgMatches {
|
||||
Command::new("get")
|
||||
.aliases(["g"])
|
||||
.arg(Arg::new("id").help("The id or path to get"))
|
||||
.arg(Arg::new("recurse").short('r').action(ArgAction::Count)),
|
||||
.arg(Arg::new("recurse").short('r').action(ArgAction::Count))
|
||||
.arg(
|
||||
Arg::new("raw")
|
||||
.long("raw")
|
||||
.action(ArgAction::SetTrue)
|
||||
.help("print the config opt value as a raw string"),
|
||||
),
|
||||
)
|
||||
.subcommand(
|
||||
Command::new("set")
|
||||
|
||||
Reference in New Issue
Block a user