ppc login works in mme main
This commit is contained in:
@@ -11,6 +11,8 @@ pub extern "C" fn part_cli() -> MizeResult<()> {
|
||||
//methods: [arg(arg: clap::Arg), subcommand(cmd: clap::Command)]
|
||||
});
|
||||
|
||||
include_native!("ArgMatches", clap::ArgMatches, {});
|
||||
|
||||
opt("state")
|
||||
.fun(Box::new(|| {
|
||||
let mize = get_global_mize().unwrap();
|
||||
@@ -25,7 +27,7 @@ pub extern "C" fn part_cli() -> MizeResult<()> {
|
||||
}));
|
||||
|
||||
|
||||
method("set_command", |args| {
|
||||
method("set_command", "String -> ()", |args| {
|
||||
let mut state = get_config("self.state")?.native_mut::<CliPartState>()?;
|
||||
let cmd = args.get_path("0")?.native::<String>()?;
|
||||
state.current_cmd_name = cmd.to_owned();
|
||||
@@ -36,7 +38,7 @@ pub extern "C" fn part_cli() -> MizeResult<()> {
|
||||
Ok(ItemData::new())
|
||||
});
|
||||
|
||||
method("subcommand", |args| {
|
||||
method("subcommand", "Command, Func -> ()", |args| {
|
||||
let mut state = get_config("self.state")?.native_mut::<CliPartState>()?;
|
||||
let subcmd = args.get_path("0")?.native_take::<clap::Command>()?;
|
||||
let action = args.get_path("1")?;
|
||||
@@ -52,7 +54,7 @@ pub extern "C" fn part_cli() -> MizeResult<()> {
|
||||
Ok(ItemData::new())
|
||||
});
|
||||
|
||||
method("run", |args| {
|
||||
method("run", "Vec<String> -> ()", |args| {
|
||||
let cmdline = args.get_path("0")?.native_take::<Vec<String>>()?;
|
||||
let mut state = get_config("self.state")?.native_mut::<CliPartState>()?;
|
||||
let cmd_name = cmdline.iter().nth(0).ok_or(mize_err!("empty cmdline"))?;
|
||||
|
||||
Reference in New Issue
Block a user