Skip to content

Commit

Permalink
feat: Add help information display and update version to 0.1.23
Browse files Browse the repository at this point in the history
This commit adds the ability to display help information using the `--help` flag. It also updates the version to 0.1.23 in `Cargo
  • Loading branch information
suenot committed Jan 24, 2025
1 parent b3d4908 commit c38fab6
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "aicommit"
version = "0.1.22"
version = "0.1.23"
edition = "2021"
authors = ["Eugen Soloviov <suenot@gmail.com>"]
description = "A CLI tool that generates concise and descriptive git commit messages using LLMs"
Expand Down
1 change: 1 addition & 0 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ A CLI tool that generates concise and descriptive git commit messages using LLMs
- ✅ Watch mode (`aicommit --watch 1m`)
- ✅ Watch with edit delay (`aicommit --watch 1m --wait-for-edit 30s`)
- ✅ OpenAI compatible API support
- ✅ Help information display (`aicommit --help`)

### Planned Features
- 🚧 Tests for each feature to prevent breaking changes
Expand Down
37 changes: 37 additions & 0 deletions src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,10 @@ struct Cli {
/// Wait for edit delay before committing (e.g. "30s" for 30 seconds)
#[arg(long = "wait-for-edit")]
wait_for_edit: Option<String>,

/// Display help information
#[arg(long = "help")]
help: bool,
}

/// Increment version string (e.g., "0.0.37" -> "0.0.38")
Expand Down Expand Up @@ -888,6 +892,39 @@ async fn main() -> Result<(), String> {
Config::check_gitignore()?;

match () {
_ if cli.help => {
println!("aicommit - A CLI tool that generates concise and descriptive git commit messages using LLMs");
println!("\nUsage:");
println!(" aicommit [OPTIONS]");
println!("\nOptions:");
println!(" --add-provider Add a new provider (interactive mode)");
println!(" --add Automatically stage all changes before commit");
println!(" --add-openrouter Add OpenRouter provider non-interactively");
println!(" --openrouter-api-key OpenRouter API key");
println!(" --openrouter-model OpenRouter model name");
println!(" --add-ollama Add Ollama provider non-interactively");
println!(" --ollama-url Ollama API URL");
println!(" --ollama-model Ollama model name");
println!(" --add-openai-compatible Add OpenAI compatible provider non-interactively");
println!(" --openai-compatible-api-key OpenAI compatible API key");
println!(" --openai-compatible-api-url OpenAI compatible API URL");
println!(" --openai-compatible-model OpenAI compatible model name");
println!(" --max-tokens Max tokens for provider configuration");
println!(" --temperature Temperature for provider configuration");
println!(" --list List all providers");
println!(" --set Set active provider");
println!(" --config Edit configuration file");
println!(" --version-file Path to version file");
println!(" --version-iterate Automatically increment version in version file");
println!(" --version-cargo Synchronize version with Cargo.toml");
println!(" --version-github Update version on GitHub");
println!(" --push Automatically push changes after commit");
println!(" --dry-run Interactive commit message generation");
println!(" --pull Pull changes before commit");
println!(" --watch Watch for changes and auto-commit");
println!(" --wait-for-edit Wait for edit delay before committing");
Ok(())
}
_ if cli.add_provider => {
if cli.add_openrouter || cli.add_ollama || cli.add_openai_compatible {
// Non-interactive provider configuration
Expand Down
2 changes: 1 addition & 1 deletion version
Original file line number Diff line number Diff line change
@@ -1 +1 @@
0.1.22
0.1.23

0 comments on commit c38fab6

Please sign in to comment.