diff options
Diffstat (limited to 'src/nix-env/main.cc')
-rw-r--r-- | src/nix-env/main.cc | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/nix-env/main.cc b/src/nix-env/main.cc index 4f299a7fe3..f9a0c19a9b 100644 --- a/src/nix-env/main.cc +++ b/src/nix-env/main.cc @@ -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); } |