feat: default option for depth from config file#315
Merged
Conversation
- If `--depth` flag is not defined (or it has an invalid value), a value from the config file will be used. - If no `depth` entry in the config file (or there is no config file), the default `usize::MAX` will be used. Added test cases: - no config and no flag defined -> `usize::MAX` should be used - config defined, but flag is not defined -> config value should be used - config is not defined, but flag is defined -> flag value should be used - both config and flag is defined -> flag value should be used Additional changes: - Fixed some clippy issues. - Added comments to the example `config.toml` file. (copy from flag description) Closes: bootandy#314 Signed-off-by: Balazs Nadasdi <efertone@pm.me>
yitsushi
commented
Feb 28, 2023
| }; | ||
| DisplayData { | ||
| initial: initial, | ||
| initial, |
Contributor
Author
There was a problem hiding this comment.
Fixes clippy warning:
warning: redundant field names in struct initialization
help: replace it with: `initial`
yitsushi
commented
Feb 28, 2023
|
|
||
| // Verify no 'symbols' reported by screen reader | ||
| assert!(!output.contains("│")); | ||
| assert!(!output.contains('│')); |
Contributor
Author
There was a problem hiding this comment.
Fixes clippy warning:
warning: single-character string constant used as pattern
help: try using a `char` instead: `'│'`
bootandy
reviewed
Mar 5, 2023
| iso=true | ||
|
|
||
| # Depth to show | ||
| depth=1 |
Owner
There was a problem hiding this comment.
I might remove this from the default config later - but you will be able to add it back in to your local config if you want it.
Contributor
Author
There was a problem hiding this comment.
Oh that's the default config? I thought it's just an example with a few options. Then I can remove it.
Contributor
Author
There was a problem hiding this comment.
Removed it from this file.
Owner
There was a problem hiding this comment.
actually this was my bad it was examples - sorry.
Signed-off-by: Efertone <efertone@pm.me>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
--depthflag is not defined (or it has an invalid value), a value from the config file will be used.depthentry in the config file (or there is no config file), the defaultusize::MAXwill be used.Added test cases:
usize::MAXshould be usedAdditional changes:
config.tomlfile. (copy from flag description)Closes #314