summaryrefslogtreecommitdiff
path: root/cmdline/apt-helper.cc
diff options
context:
space:
mode:
authorJulian Andres Klode <jak@debian.org>2020-12-18 21:00:29 +0000
committerJulian Andres Klode <jak@debian.org>2020-12-18 21:00:29 +0000
commit06ec0067057e0578f3bc515f6a97d6a9d70824f6 (patch)
treee0cb170d0a4f8caff89c2402bf24e6951b716360 /cmdline/apt-helper.cc
parentece7f5bb0afee0994a4fb4380e756ce725fe67a9 (diff)
parenta5859bafdaa6bcf12934d0fb1715a5940965e13a (diff)
Merge branch 'pu/uriencode' into 'master'
Use encoded URIs in the acquire system See merge request apt-team/apt!139
Diffstat (limited to 'cmdline/apt-helper.cc')
-rw-r--r--cmdline/apt-helper.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/cmdline/apt-helper.cc b/cmdline/apt-helper.cc
index 3d6a692e0..85795e0d2 100644
--- a/cmdline/apt-helper.cc
+++ b/cmdline/apt-helper.cc
@@ -287,6 +287,14 @@ static bool AnalyzePattern(CommandLine &CmdL) /*{{{*/
return true;
}
/*}}}*/
+static bool DoQuoteString(CommandLine &CmdL) /*{{{*/
+{
+ if (CmdL.FileSize() != 3)
+ return _error->Error("Expect two arguments, a string to quote and a string of additional characters to quote");
+ std::cout << QuoteString(CmdL.FileList[1], CmdL.FileList[2]) << '\n';
+ return true;
+}
+ /*}}}*/
static bool ShowHelp(CommandLine &) /*{{{*/
{
std::cout <<
@@ -310,6 +318,7 @@ static std::vector<aptDispatchWithHelp> GetCommands() /*{{{*/
{"drop-privs", &DropPrivsAndRun, _("drop privileges before running given command")},
{"analyze-pattern", &AnalyzePattern, _("analyse a pattern")},
{"analyse-pattern", &AnalyzePattern, nullptr},
+ {"quote-string", &DoQuoteString, nullptr},
{nullptr, nullptr, nullptr}};
}
/*}}}*/