mirror of
https://github.com/NixOS/nix
synced 2025-07-07 22:33:57 +02:00
profile: add --regex option to match packages
This commit is contained in:
parent
d6f5da51d3
commit
87741dbd21
4 changed files with 21 additions and 3 deletions
|
@ -11,7 +11,7 @@ R""(
|
|||
* Remove all packages:
|
||||
|
||||
```console
|
||||
# nix profile remove '.*'
|
||||
# nix profile remove --regex '.*'
|
||||
```
|
||||
|
||||
* Remove a package by store path:
|
||||
|
|
|
@ -6,7 +6,7 @@ R""(
|
|||
reference:
|
||||
|
||||
```console
|
||||
# nix profile upgrade '.*'
|
||||
# nix profile upgrade --regex '.*'
|
||||
```
|
||||
|
||||
* Upgrade a specific package by name:
|
||||
|
|
|
@ -508,7 +508,15 @@ public:
|
|||
|
||||
MixProfileElementMatchers()
|
||||
{
|
||||
expectArgs(ExpectedArg {
|
||||
addFlag({
|
||||
.longName = "regex",
|
||||
.description = "A regular expression to match one or more packages in the profile.",
|
||||
.labels = {"pattern"},
|
||||
.handler = {[this](std::string arg) {
|
||||
_matchers.push_back(createRegexMatcher(arg));
|
||||
}},
|
||||
});
|
||||
expectArgs({
|
||||
.label = "elements",
|
||||
.optional = true,
|
||||
.handler = {[this](std::vector<std::string> args) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue