ppc login works in mme main

This commit is contained in:
Sebastian Moser
2026-11-01 14:49:38 +01:00
parent 66b8713e3a
commit 6eedb1826a
68 changed files with 4123 additions and 1467 deletions

View File

@@ -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"))?;