diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/cli.rs | 3 | ||||
| -rw-r--r-- | src/main.rs | 5 |
2 files changed, 8 insertions, 0 deletions
@@ -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) { |
