mirror of
https://github.com/sigoden/aichat
synced 2024-11-16 06:15:26 +00:00
feat: add --info
(#79)
This commit is contained in:
parent
acddece520
commit
28f019b72c
@ -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>,
|
||||
}
|
||||
|
@ -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) {
|
||||
|
Loading…
Reference in New Issue
Block a user