Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: Use clap's built-in version command #1145

Merged
merged 3 commits into from
Feb 10, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion crates/goose-cli/src/commands/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,3 @@ pub mod agent_version;
pub mod configure;
pub mod mcp;
pub mod session;
pub mod version;
3 changes: 0 additions & 3 deletions crates/goose-cli/src/commands/version.rs

This file was deleted.

11 changes: 1 addition & 10 deletions crates/goose-cli/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ use commands::agent_version::AgentCommand;
use commands::configure::handle_configure;
use commands::mcp::run_server;
use commands::session::build_session;
use commands::version::print_version;
use console::style;
use goose::config::Config;
use logging::setup_logging;
Expand All @@ -21,11 +20,8 @@ use std::io::{self, Read};
mod test_helpers;

#[derive(Parser)]
#[command(author, about, long_about = None)]
#[command(author, version, display_name = "", about, long_about = None)]
struct Cli {
#[arg(short = 'v', long = "version")]
version: bool,

#[command(subcommand)]
command: Option<Command>,
}
Expand Down Expand Up @@ -166,11 +162,6 @@ enum CliProviderVariant {
async fn main() -> Result<()> {
let cli = Cli::parse();

if cli.version {
print_version();
return Ok(());
}

match cli.command {
Some(Command::Configure {}) => {
let _ = handle_configure().await;
Expand Down
Loading