summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/cli.rs3
-rw-r--r--src/main.rs5
2 files changed, 8 insertions, 0 deletions
diff --git a/src/cli.rs b/src/cli.rs
index 9211878..fd56e8b 100644
--- a/src/cli.rs
+++ b/src/cli.rs
@@ -24,6 +24,9 @@ pub struct Cli {
/// Select a role
#[clap(short, long)]
pub role: Option<String>,
+ /// Print information
+ #[clap(long)]
+ pub info: bool,
/// Input text
text: Vec<String>,
}
diff --git a/src/main.rs b/src/main.rs
index 589e865..58fa954 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -60,6 +60,11 @@ fn main() -> Result<()> {
if let Some(prompt) = &cli.prompt {
config.write().add_prompt(prompt)?;
}
+ if cli.info {
+ let info = config.read().info()?;
+ println!("{info}");
+ exit(0);
+ }
let no_stream = cli.no_stream;
let client = ChatGptClient::init(config.clone())?;
if atty::isnt(atty::Stream::Stdin) {