mirror of
https://github.com/SkyfallWasTaken/dinopkg.git
synced 2024-11-22 09:23:41 +00:00
Add basic command structure
This commit is contained in:
parent
76fb78605d
commit
acfcb28d28
2 changed files with 25 additions and 1 deletions
17
src/command.rs
Normal file
17
src/command.rs
Normal file
|
@ -0,0 +1,17 @@
|
||||||
|
use clap::{Parser, Subcommand};
|
||||||
|
|
||||||
|
#[derive(Parser)]
|
||||||
|
#[command(version, about, long_about = None)]
|
||||||
|
pub struct Cli {
|
||||||
|
#[command(subcommand)]
|
||||||
|
command: Commands,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Subcommand)]
|
||||||
|
pub enum Commands {
|
||||||
|
/// Run a script in package.json
|
||||||
|
Run {
|
||||||
|
/// The name of the script to run
|
||||||
|
script_name: bool,
|
||||||
|
},
|
||||||
|
}
|
|
@ -1,3 +1,10 @@
|
||||||
fn main() {
|
use clap::Parser;
|
||||||
|
|
||||||
|
mod command;
|
||||||
|
use command::Cli;
|
||||||
|
|
||||||
|
#[tokio::main]
|
||||||
|
async fn main() {
|
||||||
|
let cli = Cli::parse();
|
||||||
println!("Hello, world!");
|
println!("Hello, world!");
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue