mirror of
https://github.com/NixOS/nix
synced 2025-06-28 09:31:16 +02:00
* `nix-env -qa --description' shows human-readable descriptions of
packages (provided that they have a `meta.description' attribute). E.g., $ ./src/nix-env/nix-env -qa --description gcc gcc-4.0.2 GNU Compiler Collection, 4.0.x (cross-compiler for sparc-linux) gcc-4.0.2 GNU Compiler Collection, 4.0.x (cross-compiler for mips-linux) gcc-4.0.2 GNU Compiler Collection, 4.0.x (cross-compiler for arm-linux) gcc-4.0.2 GNU Compiler Collection, 4.0.x
This commit is contained in:
parent
a33fb2d287
commit
37d1b1cafd
7 changed files with 79 additions and 25 deletions
|
@ -699,6 +699,7 @@ static void opQuery(Globals & globals,
|
|||
bool printSystem = false;
|
||||
bool printDrvPath = false;
|
||||
bool printOutPath = false;
|
||||
bool printDescription = false;
|
||||
bool compareVersions = false;
|
||||
|
||||
enum { sInstalled, sAvailable } source = sInstalled;
|
||||
|
@ -710,6 +711,7 @@ static void opQuery(Globals & globals,
|
|||
if (*i == "--status" || *i == "-s") printStatus = true;
|
||||
else if (*i == "--no-name") printName = false;
|
||||
else if (*i == "--system") printSystem = true;
|
||||
else if (*i == "--description") printDescription = true;
|
||||
else if (*i == "--compare-versions" || *i == "-c") compareVersions = true;
|
||||
else if (*i == "--drv-path") printDrvPath = true;
|
||||
else if (*i == "--out-path") printOutPath = true;
|
||||
|
@ -808,6 +810,11 @@ static void opQuery(Globals & globals,
|
|||
? "-" : i->queryDrvPath(globals.state));
|
||||
|
||||
if (printOutPath) columns.push_back(i->queryOutPath(globals.state));
|
||||
|
||||
if (printDescription) {
|
||||
MetaInfo meta = i->queryMetaInfo(globals.state);
|
||||
columns.push_back(meta["description"]);
|
||||
}
|
||||
|
||||
table.push_back(columns);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue