Skip to content

Commit

Permalink
nix-env: Fix parsing of --system
Browse files Browse the repository at this point in the history
  • Loading branch information
edolstra committed Feb 8, 2018
1 parent 444bae4 commit ad97a21
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/libmain/common-args.cc
Expand Up @@ -37,6 +37,10 @@ MixCommonArgs::MixCommonArgs(const string & programName)

std::string cat = "config";
settings.convertToArgs(*this, cat);

// Backward compatibility hack: nix-env already had a --system flag.
if (programName == "nix-env") longFlags.erase("system");

hiddenCategories.insert(cat);
}

Expand Down
3 changes: 3 additions & 0 deletions tests/user-envs.sh
Expand Up @@ -24,6 +24,9 @@ rm -f $HOME/.nix-defexpr
ln -s $(pwd)/user-envs.nix $HOME/.nix-defexpr
nix-env -qa '*' --description | grep -q silly

# Query the system.
nix-env -qa '*' --system | grep -q $system

# Install "foo-1.0".
nix-env -i foo-1.0

Expand Down

0 comments on commit ad97a21

Please sign in to comment.