Skip to content

Conversation

@roberth
Copy link
Member

@roberth roberth commented May 30, 2024

Motivation

Start implementing #10504.

This is part of an effort to bring more structure to the CLI subcommands.

nix env will be about the process environment.
Future commands may include nix env run and nix env print-env.

It is also somewhat analogous to the planned nix dev shell (currently nix develop), which is less about environment variables, and more about running a development shell, which is a more powerful command, but also requires more setup.

Most of the code has just moved to env.cc.

Context

Priorities and Process

Add 👍 to pull requests you find important.

The Nix maintainer team uses a GitHub project board to schedule and track reviews.

@github-actions github-actions bot added documentation new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority labels May 30, 2024
Comment on lines 7 to 25
struct CmdEnv : NixMultiCommand
{
CmdEnv() : NixMultiCommand("env", RegisterCommand::getCommandsFor({"env"}))
{ }

std::string description() override
{
return "manipulate the process environment";
}

Category category() override { return catUtility; }
};

static auto rCmdEnv = registerCommand<CmdEnv>("env");
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is new and perfectly analogous to CmdStore.

}
};

static auto rCmdShell = registerCommand2<CmdShell>({"env", "shell"});
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Moved verbatim, except for the last line.

The last line has the canonical name, which appears in the help.
nix shell --help opens that page directly, and all the rest is also transparently aliased, without warning.

@roberth roberth changed the title Rename to nix env shell Add nix env shell May 30, 2024
@roberth roberth force-pushed the issue-10504-nix-env-shell branch from 73c8e1f to d93cc11 Compare May 30, 2024 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation new-cli Relating to the "nix" command with-tests Issues related to testing. PRs with tests have some priority

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants