summaryrefslogtreecommitdiff
path: root/cmdline/apt-config.cc
diff options
context:
space:
mode:
authorMichael Vogt <michael.vogt@ubuntu.com>2012-04-25 17:02:24 +0200
committerMichael Vogt <michael.vogt@ubuntu.com>2012-04-25 17:02:24 +0200
commit99b4fefe0f303cf5ae5e8b9116404fc0fcc96e47 (patch)
tree1a3b69e8d10cbf78a7ad278dab0e5b40bf24c69f /cmdline/apt-config.cc
parent4d74894b85227f42b65a84f459f011d74946e4f4 (diff)
parentcc04f4ce9eaaf0945775d5233806de7da5d21ff6 (diff)
merged from donkult
Diffstat (limited to 'cmdline/apt-config.cc')
-rw-r--r--cmdline/apt-config.cc10
1 files changed, 9 insertions, 1 deletions
diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc
index 79ae944df..397ce32df 100644
--- a/cmdline/apt-config.cc
+++ b/cmdline/apt-config.cc
@@ -63,7 +63,13 @@ bool DoShell(CommandLine &CmdL)
/* */
bool DoDump(CommandLine &CmdL)
{
- _config->Dump(cout);
+ bool const empty = _config->FindB("APT::Config::Dump::EmptyValue", true);
+ std::string const format = _config->Find("APT::Config::Dump::Format", "%f \"%v\";\n");
+ if (CmdL.FileSize() == 1)
+ _config->Dump(cout, NULL, format.c_str(), empty);
+ else
+ for (const char **I = CmdL.FileList + 1; *I != 0; ++I)
+ _config->Dump(cout, *I, format.c_str(), empty);
return true;
}
/*}}}*/
@@ -100,6 +106,8 @@ int main(int argc,const char *argv[]) /*{{{*/
{'v',"version","version",0},
{'c',"config-file",0,CommandLine::ConfigFile},
{'o',"option",0,CommandLine::ArbItem},
+ {0,"empty","APT::Config::Dump::EmptyValue",CommandLine::Boolean},
+ {0,"format","APT::Config::Dump::Format",CommandLine::HasArg},
{0,0,0,0}};
CommandLine::Dispatch Cmds[] = {{"shell",&DoShell},
{"dump",&DoDump},