summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/config.rs4
-rw-r--r--src/main.rs12
2 files changed, 14 insertions, 2 deletions
diff --git a/src/config.rs b/src/config.rs
index 5f76315..0feed64 100644
--- a/src/config.rs
+++ b/src/config.rs
@@ -12,7 +12,7 @@ pub struct Config {
/// Used only for debugging
#[serde(default)]
pub dry_run: bool,
- /// Predefined rules
+ /// Predefined roles
#[serde(default)]
pub roles: Vec<Role>,
}
@@ -31,7 +31,7 @@ impl Config {
pub struct Role {
/// Role name
pub name: String,
- /// Prompt text send to ai for setting up a rule
+ /// Prompt text send to ai for setting up a role
pub prompt: String,
/// First sentense will append to prompt
pub first_sentense: String,
diff --git a/src/main.rs b/src/main.rs
index de61a03..8ee2e96 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -49,6 +49,13 @@ fn start() -> Result<()> {
env!("CARGO_PKG_REPOSITORY")
))
.arg(
+ Arg::new("list-roles")
+ .short('L')
+ .long("list-roles")
+ .action(ArgAction::SetTrue)
+ .help("List all roles"),
+ )
+ .arg(
Arg::new("role")
.short('r')
.long("role")
@@ -82,6 +89,11 @@ fn start() -> Result<()> {
text = Some(role.generate(text_));
};
+ if matches.get_flag("list-roles") {
+ config.roles.iter().for_each(|v| println!("{}", v.name));
+ exit(1);
+ }
+
let client = init_client(&config)?;
let runtime = init_runtime()?;
match text {