This commit is contained in:
Sebastian Moser
2026-10-23 15:27:31 +02:00
parent 9141fc5441
commit 37cb94d1d4
11 changed files with 482 additions and 63 deletions

View File

@@ -6,14 +6,10 @@ use mize::prelude::*;
#[unsafe(no_mangle)]
pub extern "C" fn part_cli() -> MizeResult<()> {
// Register methods of clap::Command with mize
// Note: associated functions like `new` require arguments, so they're not included here
// Use the block syntax to separate associated functions from methods:
// include_native!("Command", clap::Command, {
// associated: [some_associated_fn], // functions called as Type::fn()
// methods: [arg, subcommand] // methods called as this.fn()
// });
include_native!("Command", clap::Command, []);
include_native!("Command", clap::Command, {
associated: [new(name: String)],
//methods: [arg(arg: clap::Arg), subcommand(cmd: clap::Command)]
});
opt("state")
.fun(Box::new(|| {