-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
improve argument parsing and documentaion & generate screen into exis…
…ting feature
- Loading branch information
1 parent
357cec9
commit af9d8ed
Showing
7 changed files
with
487 additions
and
60 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 |
---|---|---|
@@ -1 +1,2 @@ | ||
/target | ||
/test |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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
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,51 @@ | ||
use clap::{Parser, Subcommand}; | ||
|
||
#[derive(Parser)] | ||
#[command(name = "Feature Generator")] | ||
#[command(author = "Aradi Patrik <[email protected]>")] | ||
#[command(version = "1.0")] | ||
#[command(about = "Generates new features and screens inside them", long_about = None)] | ||
pub struct Cli { | ||
/// Turn debugging on | ||
#[arg(short, long, action = clap::ArgAction::SetTrue)] | ||
pub debug: bool, | ||
|
||
/// base package name | ||
#[arg(short, long)] | ||
pub base_package: String, | ||
|
||
/// Application name | ||
#[arg(short, long)] | ||
pub app_name: String, | ||
|
||
#[command(subcommand)] | ||
pub command: Commands, | ||
} | ||
|
||
#[derive(Subcommand)] | ||
pub enum Commands { | ||
/// Generates new feature module | ||
GenMod { | ||
/// The name of the new feature | ||
#[arg(short, long)] | ||
feature: String, | ||
|
||
/// The name of the starting screen | ||
#[arg(short, long)] | ||
start_screen: String | ||
}, | ||
/// Generates new screen for a feature module | ||
GenScreen { | ||
/// The name of the existing feature | ||
#[arg(short, long)] | ||
feature: String, | ||
|
||
/// The name of the new screen | ||
#[arg(short, long)] | ||
screen: String | ||
} | ||
} | ||
|
||
pub fn parse_args() -> Cli { | ||
return Cli::parse() | ||
} |
Oops, something went wrong.