diff options
author | Griffin Smith <root@gws.fyi> | 2022-09-18T19·59-0400 |
---|---|---|
committer | clbot <clbot@tvl.fyi> | 2022-09-18T22·08+0000 |
commit | e720545e5b32683a3cdb135b6004a06304e025aa (patch) | |
tree | 33414930f82266722a53a184604a694448bd6a2b /tvix/eval/Cargo.toml | |
parent | 6f70f325138b48f2c9b03a2103371663cb210d7c (diff) |
refactor(tvix/eval): use Clap for arg+env parsing r/4911
Refactor the environment variable and argument parsing for the tvix repl to use Clap instead of doing things ad-hoc, and thread through options obtained from environment variables via explicit arguments rather than obtaining them from the environment as they're needed. This makes adding more flags more sustainable, and also makes the binary fully self-documenting, including supported env vars, via `--help`. Change-Id: Ib1f6a0cd20056e8c9196760ff755fa5729667760 Reviewed-on: https://cl.tvl.fyi/c/depot/+/6653 Autosubmit: grfn <grfn@gws.fyi> Tested-by: BuildkiteCI Reviewed-by: tazjin <tazjin@tvl.su>
Diffstat (limited to 'tvix/eval/Cargo.toml')
-rw-r--r-- | tvix/eval/Cargo.toml | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/tvix/eval/Cargo.toml b/tvix/eval/Cargo.toml index 1c56f3171645..bf34159656aa 100644 --- a/tvix/eval/Cargo.toml +++ b/tvix/eval/Cargo.toml @@ -23,6 +23,7 @@ codemap = "0.1.3" codemap-diagnostic = "0.1.1" proptest = { version = "1.0.0", default_features = false, features = ["std", "alloc", "break-dead-code", "tempfile"], optional = true } test-strategy = { version = "0.2.1", optional = true } +clap = { version = "3.2.22", optional = true, features = ["derive", "env"] } # rnix has not been released in a while (as of 2022-09-18), we will # use it from git. @@ -45,7 +46,7 @@ default = [ "repl", "arbitrary" ] nix_tests = [] # Enables building the binary (tvix-eval REPL) -repl = [ "dep:rustyline" ] +repl = [ "dep:rustyline", "dep:clap" ] # Enables Arbitrary impls for internal types (required to run tests) arbitrary = [ "proptest", "test-strategy" ] |