Skip to content

Commit

Permalink
Use structopt instead of clap (#8)
Browse files Browse the repository at this point in the history
* Update dependencies and refactor code for better readability and performance

1. Update dependencies in Cargo.lock: Add new dependencies such as ansi_term, atty, and clap. Update the source and checksum for each package for accurate tracking of dependencies and versions.

2. Upgrade source code in config.rs: Replace the deprecated argument parsing logic with a simplified version. Replace "gpt-4-turbo-preview" with "gpt-4o" for improving model performance.

3. Refactor run function in config.rs: Simplify the logic by removing unnecessary match args subcommand.

4. Improve command line interface in main.rs: Switch from clap to StructOpt for better CLI functionality. Remove redundant arguments and commands for a cleaner and more efficient CLI.

5. Miscellaneous Changes: Correct some minor typos and inconsistencies, make max tokens in app to 2024 from 512 for better performance.

* Remove Git AI Command Line Interface comment from main.rs

* Refactor hook.rs and add new struct

- Remove unused lines from hook.rs
- Import StructOpt for command line argument parsing
- Define a new StructOpt-based Args struct to handle and parse commit type, sha1, and commit message file from the command line
- Update the main function to use the new Args struct for argument parsing and file writing
- Replace direct file operation with std::fs::write for better error handling and code readability

* Remove anstyle and clap dependencies, replace clap::Parser with structopt::StructOpt

The commit removes the 'anstyle' and 'clap' dependencies from the project. As these dependencies are not being actively used, removing them simplifies the setup and reduces potential security risks. The commit also replaces `clap::Parser` with `structopt::StructOpt` in hook.rs for command-line argument parsing, as the latter provides more flexibility and better handling of command line arguments.

* Refactor hook.rs to remove unnecessary string conversion while writing to commit_msg_file

* Update dependencies addr2line, backtrace, gimli, and object

This commit updates the following dependencies and their respective checksums:
- addr2line from version 0.21.0 to 0.22.0
- backtrace from 0.3.71 to 0.3.72
- gimli from 0.28.1 to 0.29.0
- object from 0.32.2 to 0.35.0

These updates are in line with the continuous effort to keep dependencies up-to-date and maintain project reliability.
  • Loading branch information
oleander authored May 28, 2024
1 parent bee36c6 commit b769be8
Show file tree
Hide file tree
Showing 6 changed files with 286 additions and 278 deletions.
Loading

0 comments on commit b769be8

Please sign in to comment.