-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
30 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
use clap::Parser; | ||
|
||
#[derive(Parser, Debug)] | ||
pub struct Create { | ||
#[clap(short, long)] | ||
name: String, | ||
} | ||
|
||
pub fn handle(args: Create) { | ||
println!("Create command: {}", args.name) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
pub mod create; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,14 +1,26 @@ | ||
use clap::Parser; | ||
use clap::{Parser, Subcommand}; | ||
|
||
mod commands; | ||
|
||
/// Create, build, and release Android apps faster without Android Studio | ||
#[derive(Parser, Debug)] | ||
#[clap(name = "android")] | ||
#[clap(name = "Android CLI")] | ||
#[clap(author, version, about)] | ||
#[clap(author = "Syed Ahkam <[email protected]>")] | ||
#[clap(arg_required_else_help = true)] | ||
struct Cli {} | ||
struct Cli { | ||
#[clap(subcommand)] | ||
command: SubCommand, | ||
} | ||
|
||
#[derive(Subcommand, Debug)] | ||
enum SubCommand { | ||
Create(commands::create::Create), | ||
} | ||
|
||
fn main() { | ||
let _args = Cli::parse(); | ||
let args = Cli::parse(); | ||
|
||
println!("Hello, world!"); | ||
match args.command { | ||
SubCommand::Create(args) => commands::create::handle(args), | ||
} | ||
} |