You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Aug 23, 2022. It is now read-only.
use thunder;use clap;use thunder::thunderclap;structMyApp;#[thunderclap(param:String:"A global var")]implMyApp{/// Scan a directoryfnscan(source_dir:String){println!("param={}", param);}}fnmain(){MyApp::start();}
returns an error when running compiling:
$ cargo run
Compiling test-thunder v0.1.0 (/home/xxx/tmp/test-thunder)
error[E0425]: cannot find value `param` in this scope
--> src/main.rs:8:1
|
8 | #[thunderclap(param: String: "A global var")]
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ not found in this scope
or also
$ cargo run --param hey
error: Found argument '--param' which wasn't expected, or isn't valid in this context
USAGE:
cargo run [OPTIONS] [--] [args]...
For more information try --help
How are global variable supposed to be used? Can you help with some more detailed examples?