fully compiles
This commit is contained in:
@@ -6,7 +6,14 @@ use mize::prelude::*;
|
||||
#[unsafe(no_mangle)]
|
||||
pub extern "C" fn part_cli() -> MizeResult<()> {
|
||||
|
||||
include_native!("Command", clap::Command, [new]);
|
||||
// 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, []);
|
||||
|
||||
opt("state")
|
||||
.fun(Box::new(|| {
|
||||
|
||||
@@ -12,6 +12,7 @@ crate-type = [ "cdylib", "rlib" ]
|
||||
[dependencies]
|
||||
log = "0.4.34"
|
||||
mize = { workspace = true }
|
||||
cmd_lib = { version = "2.0.1", optional = false }
|
||||
|
||||
|
||||
[profile.dev]
|
||||
|
||||
Reference in New Issue
Block a user