diff options
author | Michael Vogt <michael.vogt@ubuntu.com> | 2012-05-22 16:07:49 +0200 |
---|---|---|
committer | Michael Vogt <michael.vogt@ubuntu.com> | 2012-05-22 16:07:49 +0200 |
commit | 800694cbf33e206935dc9e6e8fa6e9a036b8efad (patch) | |
tree | 1557d96ee0f463a020b11604146be66fb9809a31 /cmdline/apt-config.cc | |
parent | 6c0c0387e616f8d04f00916fbd1fe899acd265cd (diff) | |
parent | 1351329e376a8dbe7780693693d0f3db0ec749fa (diff) |
merged (and resolved a bunch of conflicts) of the debian-sid branch
Diffstat (limited to 'cmdline/apt-config.cc')
-rw-r--r-- | cmdline/apt-config.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/cmdline/apt-config.cc b/cmdline/apt-config.cc index 47bedfe3f..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; } /*}}}*/ @@ -72,7 +78,7 @@ bool DoDump(CommandLine &CmdL) /* */ int ShowHelp() { - ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,VERSION, + ioprintf(cout,_("%s %s for %s compiled on %s %s\n"),PACKAGE,PACKAGE_VERSION, COMMON_ARCH,__DATE__,__TIME__); if (_config->FindB("version") == true) return 0; @@ -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}, |