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
|
||||
[group('dev')]
|
||||
run:
|
||||
cargo run
|
||||
run *args:
|
||||
cargo run {{args}}
|
||||
|
||||
# Clean up previous builds
|
||||
[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]
|
||||
async fn main() {
|
||||
println!("Hello, dictionary!");
|
||||
let args = Args::parse();
|
||||
println!("{:?}", args);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user