[PR #315] [MERGED] feat: default option for depth from config file #419

Closed
opened 2026-06-08 11:28:04 +03:00 by zhus · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/bootandy/dust/pull/315
Author: @yitsushi
Created: 2/28/2023
Status: Merged
Merged: 3/7/2023
Merged by: @bootandy

Base: masterHead: default-depth


📝 Commits (2)

  • 78df4be feat: default option for depth from config file
  • ff56793 remove depth from config.toml and fix style issues

📊 Changes

5 files changed (+66 additions, -3 deletions)

View changed files

📝 config/config.toml (+15 -0)
📝 src/config.rs (+48 -0)
📝 src/display.rs (+1 -1)
📝 src/main.rs (+1 -1)
📝 tests/test_flags.rs (+1 -1)

📄 Description

  • 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 #314


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/bootandy/dust/pull/315 **Author:** [@yitsushi](https://github.com/yitsushi) **Created:** 2/28/2023 **Status:** ✅ Merged **Merged:** 3/7/2023 **Merged by:** [@bootandy](https://github.com/bootandy) **Base:** `master` ← **Head:** `default-depth` --- ### 📝 Commits (2) - [`78df4be`](https://github.com/bootandy/dust/commit/78df4becfd9b1c7f883da5e6699e15823befbe11) feat: default option for depth from config file - [`ff56793`](https://github.com/bootandy/dust/commit/ff56793f8d4d1f0c9603d915f54cbcd72dd1f6f6) remove depth from config.toml and fix style issues ### 📊 Changes **5 files changed** (+66 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `config/config.toml` (+15 -0) 📝 `src/config.rs` (+48 -0) 📝 `src/display.rs` (+1 -1) 📝 `src/main.rs` (+1 -1) 📝 `tests/test_flags.rs` (+1 -1) </details> ### 📄 Description - 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 #314 --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
zhus added the pull-request label 2026-06-08 11:28:04 +03:00
zhus closed this issue 2026-06-08 11:28:05 +03:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: bootandy/archived-dust#419