feat(cli): implement clap
added clap, justfile now allows passing args to run recipe
This commit is contained in:
@@ -3,8 +3,8 @@ _default:
|
|||||||
|
|
||||||
# Run the bot
|
# Run the bot
|
||||||
[group('dev')]
|
[group('dev')]
|
||||||
run:
|
run *args:
|
||||||
cargo run
|
cargo run {{args}}
|
||||||
|
|
||||||
# Clean up previous builds
|
# Clean up previous builds
|
||||||
[group('build')]
|
[group('build')]
|
||||||
|
|||||||
+10
-1
@@ -1,4 +1,13 @@
|
|||||||
|
use clap::Parser;
|
||||||
|
|
||||||
|
#[derive(Parser, Debug)]
|
||||||
|
#[command(version, about, long_about = None)]
|
||||||
|
struct Args {
|
||||||
|
word: String,
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::main]
|
#[tokio::main]
|
||||||
async fn main() {
|
async fn main() {
|
||||||
println!("Hello, dictionary!");
|
let args = Args::parse();
|
||||||
|
println!("{:?}", args);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user