-
-
Notifications
You must be signed in to change notification settings - Fork 9
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(config): refactor the config system #62
Conversation
Merge the base
…t into the `CliArgs` struct to improve the code
…k_help` to `true`
Codecov ReportPatch coverage:
❗ Your organization is not using the GitHub App Integration. As a result you may experience degraded service beginning May 15th. Please install the Github App Integration for your organization. Read more. Additional details and impacted files@@ Coverage Diff @@
## main #62 +/- ##
==========================================
- Coverage 80.85% 78.43% -2.41%
==========================================
Files 14 14
Lines 595 598 +3
==========================================
- Hits 481 469 -12
- Misses 114 129 +15
☔ View full report in Codecov by Sentry. |
update_args
function from the Config
struct into the CliArgs
Config
struct the main setings container
…it dosn't exisits
Config
struct the main setings containerConfig
struct the main settings container and auto-create the config file if it doesn't exist
…it dosn't exisits
…to refactor-configs-code
…forks/halp into refactor-configs-code
…forks/halp into refactor-configs-code
…it dosn't exisits
…to refactor-configs-code
…e default config file
I messed up the commit history a little bit in my attempt to fix the typo in 2f2ccc0 commit message, sorry about that |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks! 🐻
Hey @0x61nas I just realized |
Oh, I didn't notice that. I'll fix this issue quickly as I can |
81: fix(cli): fix the check option r=orhun a=0x61nas <!--- Thank you for contributing to halp! 🐙 --> ## Description Add the missing code to override the check args in the config instance with the `--check` CLI option ## Motivation and Context - Fix the issue that's introduced in #62 ## How Has This Been Tested? - I trayed to pass `--check="-h"` and it worked as expected - I trayed to pass ` --check='-h' --check='-V'` and it worked as expected also ## Types of Changes - [x] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Documentation (no code change) - [ ] Refactor (refactoring production code) - [ ] Other <!--- (provide information) --> ## Checklist: - [x] My code follows the code style of this project. - [x] I have updated the documentation accordingly. - [x] I have formatted the code with [rustfmt](https://github.com/rust-lang/rustfmt). - [x] I checked the lints with [clippy](https://github.com/rust-lang/rust-clippy). - [x] I have added tests to cover my changes. - [x] All new and existing tests passed. > This's an alternative to #79 Co-authored-by: Anas Elgarhy <[email protected]>
Description
Make the
Config
the main settings container instead ofCliArgs
. and auto-create the config file in~/.confg/halp/config.toml
if it doesn't exist, and give the command-line arguments priority over the config fileMotivation and Context
update_args
function from theConfig
struct into theCliArgs
#61Fix: no help flag doesn't work when I have set thecheck_help
value to true in the config file #63check_version
value to true in the config file #64How Has This Been Tested?
cargo t --lib
, all the tests are passedcargo r -- --help
andcargo r -- plz --help
, it gives me the expected output--no-version
and--no-help
flagsTypes of Changes
Checklist: