lix/src
John Ericson 4607ac7aed Fix handling of experimental features mid-parse
If we conditionally "declare" the argument, as we did before, based upon
weather the feature is enabled, commands like

    nix --experimental-features=foo ... --thing-gated-on-foo

won't work, because the experimental feature isn't enabled until *after*
we start parsing.

Instead, allow arguments to also be associated with experimental
features (just as we did for builtins and settings), and then the
command line parser will filter out the experimental ones.

Since the effects of arguments (handler functions) are performed right
away, we get the required behavior: earlier arguments can enable later
arguments enabled!

There is just one catch: we want to keep non-positional
flags...non-positional. So if

    nix --experimental-features=foo ... --thing-gated-on-foo

works, then

    nix --thing-gated-on-foo --experimental-features=foo ...

should also work.

This is not my favorite long-term solution, but for now this is
implemented by delaying the requirement of needed experimental features
until *after* all the arguments have been parsed.
2023-03-20 11:35:34 -04:00
..
build-remote Move enabled experimental feature to libutil struct 2023-03-20 11:05:22 -04:00
libcmd Move enabled experimental feature to libutil struct 2023-03-20 11:05:22 -04:00
libexpr Move enabled experimental feature to libutil struct 2023-03-20 11:05:22 -04:00
libfetchers Mark experimental features on settings 2023-03-20 11:06:40 -04:00
libmain Merge pull request #7889 from sidkshatriya/sorted-fetch-paths 2023-03-07 11:58:10 +01:00
libstore Move enabled experimental feature to libutil struct 2023-03-20 11:05:22 -04:00
libutil Fix handling of experimental features mid-parse 2023-03-20 11:35:34 -04:00
nix Fix handling of experimental features mid-parse 2023-03-20 11:35:34 -04:00
nix-build Move enabled experimental feature to libutil struct 2023-03-20 11:05:22 -04:00
nix-channel A setting to follow XDG Base Directory standard 2023-02-10 20:14:06 +04:00
nix-collect-garbage Fix nix-collect-garbage -d with the new profile location 2023-03-07 13:08:04 +01:00
nix-copy-closure Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
nix-env Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
nix-instantiate Revert to copyStore = true for nix-instantiate and nix-env 2022-08-23 14:40:27 +02:00
nix-store Fix another uninitialized variable 2023-03-09 15:30:53 +01:00
resolve-system-dependencies Remove FormatOrString and remaining uses of format() 2023-03-02 15:57:54 +01:00
toml11 Replace cpptoml with toml11 2021-12-17 22:03:33 +01:00