Skip to content

Commit

Permalink
Merge pull request #47 from vincentdephily/configfile
Browse files Browse the repository at this point in the history
Config file support
  • Loading branch information
vincentdephily authored Feb 8, 2024
2 parents 6fd861d + 4880142 commit 23e52a2
Show file tree
Hide file tree
Showing 16 changed files with 976 additions and 549 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,11 @@

* Support searching by multiple terms
- eg `emlop s -e gcc clang llvm rust`
* Support configuration file
- Located by default in `~/.config/emlop.toml`, overridable with `$EMLOP_CONFIG` env var
- Example config added to repo, should be installed alongside emlop docs
- Config options, when available, always correspond to a cli arg
- Many flags/args now take an optional `no` value, so the cli can override the conf
* Improve predict:
- Autodetect `tmpdir` using currently running emerge processes
- Support multiple `--tmpdir` arguments
Expand Down
75 changes: 75 additions & 0 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,9 @@ edition = "2021"
rust-version = "1.70.0"
exclude = ["benches", "docs", "rustfmt.toml", ".github", ".gitignore"]

[lints.clippy]
missing_const_for_fn = "warn"

[dependencies]
anyhow = "1.0.32"
atoi = "2.0.0"
Expand All @@ -30,6 +33,7 @@ rev_lines = "0.3.0"
serde = { version = "1.0.184", features = ["derive"] }
serde_json = "1.0.89"
time = {version = "~0.3.18", features = ["parsing", "formatting", "local-offset", "macros"]}
toml = "0.8.8"

[dev-dependencies]
assert_cmd = "~2.0.0"
Expand Down
30 changes: 30 additions & 0 deletions emlop.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
# This is an example `emlop` config file.
#
# It is loaded from `$HOME/.config/emlop.toml` by default.
# Use `$EMLOP_CONFIG` to set a different location, empty string to disable config loading.
# Entries have the same name and format as command-line args, see `emlop <command> --help`.
# Some args are only avaible via the command line.

# logfile = "/var/log/emerge.log"
# date = "rfc2822"
# duration = "human"
# utc = true
# header = true
[log]
# show = "mus"
# starttime = true
[predict]
# show = "emt"
# avg = "arith"
# limit = 20
# unknown = 300
# tmpdir = ["/foo", "/bar"]
[stats]
# show = "pts"
# avg = "arith"
# limit = 20
# group = "y"
[accuracy]
# show = "mt"
# avg = "arith"
# limit = 20
Loading

0 comments on commit 23e52a2

Please sign in to comment.