summaryrefslogtreecommitdiff
path: root/apt-pkg/contrib/cmndline.cc
AgeCommit message (Collapse)AuthorFilesLines
2019-07-08Apply various suggestions by cppcheckDavid Kalnischkies1-1/+2
Reported-By: cppcheck
2018-05-07Remove obsolete RCS keywordsGuillem Jover1-1/+0
Prompted-by: Jakub Wilk <jwilk@debian.org>
2017-07-12Reformat and sort all includes with clang-formatJulian Andres Klode1-3/+3
This makes it easier to see which headers includes what. The changes were done by running git grep -l '#\s*include' \ | grep -E '.(cc|h)$' \ | xargs sed -i -E 's/(^\s*)#(\s*)include/\1#\2 include/' To modify all include lines by adding a space, and then running ./git-clang-format.sh.
2017-03-19Fix and avoid quoting in CommandLine::AsStringDavid Kalnischkies1-4/+10
In the intended usecase where this serves as a hack there is no problem with double/single quotes being present as we write it to a log file only, but nowadays our calling of apt-key produces a temporary config file containing this "setting" as well and suddently quoting is important as the config file syntax is allergic to it. So the fix is to ignore all quoting whatsoever in the input and just quote (with singles) the option values with spaces. That gives us 99% of the time the correct result and the 1% where the quote is an integral element of the option … doesn't exist – or has bigger problems than a log file not containing the quote. Same goes for newlines in values. LP: #1672710
2015-11-19support setting empty values (sanely) & removing support forDavid Kalnischkies1-20/+5
space-gapping: '-o option= value' That is a very old feature (straight from 1998), but it is super surprising if you try setting empty values and instead get error messages or a non-empty value as the next parameter is treated as the value – which could have been empty, so if for some reason you need a compatible way of setting an empty value try: '-o option="" ""'. I can only guess that the idea was to support '-o option value', but we survived 17 years without it, we will do fine in the future I guess. Similar is the case for '-t= testing' even through '-t testing' existed before and the code even tried to detect mistakes like '-t= -b' … all gone now. Technically that is as its removing a feature replacing it with another a major interface break. In practice I really hope for my and their sanity that nobody was using this; but if for some reaon you do: Remove the space and be done. I found the patch and the bugreport actually only after the fact, but its reassuring that others are puzzled by this as well and hence a thanks is in perfect order here as the patch is practical identical [expect that this one here adds tests and other bonus items]. Thanks: Daniel Hartwig for initial patch. Closes: 693092
2015-11-04move apts cmdline helper type into -privateDavid Kalnischkies1-58/+3
Its not as simple as I initially thought to abstract this enough to make it globally usable, so lets not pollute global namespace with this for now. Git-Dch: Ignore
2015-11-04deduplicate main methodsDavid Kalnischkies1-1/+1
All mains pretty much do the same thing, so lets try a little harder to move the common parts into -private to have the real differences more visible. Git-Dch: Ignore
2015-11-04split up help messages for simpler reuseDavid Kalnischkies1-2/+60
That is one huge commit with busy work only: Help messages used to be one big translateable string, which is a pain for translators and hard to reuse for us. This change there 'explodes' this single string into new string for each documented string trying hard to split up the translated messages as well. This actually restores many translations as previously adding a single command made all of the bug message fuzzy. The splitup also highlighted that its easy to forget a line, duplicate one and similar stuff. Git-Dch: Ignore
2015-08-14Also add 'in combination with the other options.' to another errorJulian Andres Klode1-1/+1
Gbp-Dch: ignore
2015-08-14Say "in combination with the other options" if an option is not understoodJulian Andres Klode1-3/+3
Closes: #762758
2014-11-09streamline display of --help in all toolsDavid Kalnischkies1-0/+3
By convention, if I run a tool with --help or --version I expect it to exit successfully with the usage, while if I do call it wrong (like without any parameters) I expect the usage message shown with a non-zero exit.
2014-09-28allow options between command and -- on commandlineDavid Kalnischkies1-8/+11
This used to work before we implemented a stricter commandline parser and e.g. the dd-schroot-cmd command constructs commandlines like this. Reported-By: Helmut Grohne
2014-03-13cleanup headers and especially #includes everywhereDavid Kalnischkies1-0/+5
Beside being a bit cleaner it hopefully also resolves oddball problems I have with high levels of parallel jobs. Git-Dch: Ignore Reported-By: iwyu (include-what-you-use)
2014-02-22Fix typos in documentation (codespell)Michael Vogt1-1/+1
2013-08-22Merge remote-tracking branch 'mvo/bugfix/coverity' into debian/sidMichael Vogt1-0/+1
Conflicts: apt-pkg/tagfile.h
2013-08-12squash merge of the feature/apt-binary branch without the changes from ↵Michael Vogt1-0/+48
experimental
2013-08-12some more coverity fixesMichael Vogt1-0/+1
2012-06-09fix segfault with empty LongOpt in --no-* branchDavid Kalnischkies1-1/+2
2012-06-09* apt-pkg/contrib/cmdline.cc:Daniel Hartwig1-2/+3
- apply patch from Daniel Hartwig to fix a segfault in case the LongOpt is empty (Closes: #676331)
2011-10-30merge with my debian-sid branchDavid Kalnischkies1-17/+11
2011-09-21convert a few for-loop char finds to proper strchr and memchrDavid Kalnischkies1-17/+11
2011-09-19use forward declaration in headers if possible instead of includesDavid Kalnischkies1-0/+1
2011-09-13reorder includes: add <config.h> if needed and include it at firstDavid Kalnischkies1-1/+3
2010-05-31* apt-pkg/contrib/cmdline.cc:David Kalnischkies1-2/+2
- fix segfault in SaveInConfig caused by writing over char[] sizes
2010-03-12* apt-pkg/deb/dpkgpm.cc:David Kalnischkies1-1/+41
- if available store the Commandline in the history * apt-pkg/contrib/cmndline.cc: - save Commandline in Commandline::AsString for logging
2008-10-03Applying #298821 patch for further arbitary typosLuca Bruno1-1/+1
2007-06-08* remove all the remaining #pragma implementationMichael Vogt1-3/+0
2004-09-20Typo fixes.Arch Librarian1-3/+3
Author: doogie Date: 2003-02-10 01:40:58 GMT Typo fixes.
2004-09-20Some more g++-3.2 fixes.Arch Librarian1-1/+2
Author: doogie Date: 2002-11-11 06:55:50 GMT Some more g++-3.2 fixes.
2004-09-20PD licenseArch Librarian1-1/+4
Author: jgg Date: 2002-09-14 05:28:38 GMT PD license
2004-09-20Fixed -- argument bugArch Librarian1-1/+4
Author: jgg Date: 2001-06-09 22:39:48 GMT Fixed -- argument bug
2004-09-20Join with aliencodeArch Librarian1-14/+16
Author: jgg Date: 2001-02-20 07:03:16 GMT Join with aliencode
2004-09-20Changed handling of the -q optionArch Librarian1-2/+2
Author: jgg Date: 1999-05-14 02:57:48 GMT Changed handling of the -q option
2004-09-20Moved strutl.hArch Librarian1-2/+2
Author: jgg Date: 1999-01-27 02:48:52 GMT Moved strutl.h
2004-09-20Dsync mergeArch Librarian1-3/+8
Author: jgg Date: 1999-01-18 06:20:07 GMT Dsync merge
2004-09-20Release supportArch Librarian1-3/+7
Author: jgg Date: 1998-12-14 02:23:46 GMT Release support
2004-09-20More CD supportArch Librarian1-2/+25
Author: jgg Date: 1998-11-25 23:54:06 GMT More CD support
2004-09-20Fixed long option parsingArch Librarian1-9/+20
Author: jgg Date: 1998-10-24 20:14:34 GMT Fixed long option parsing
2004-09-20Start on acquire stuffArch Librarian1-25/+4
Author: jgg Date: 1998-10-20 02:39:12 GMT Start on acquire stuff
2004-09-20SyncArch Librarian1-3/+11
Author: jgg Date: 1998-10-08 04:54:58 GMT Sync
2004-09-20SyncArch Librarian1-1/+38
Author: jgg Date: 1998-09-26 05:34:18 GMT Sync
2004-09-20SyncArch Librarian1-0/+280
Author: jgg Date: 1998-09-22 05:30:24 GMT Sync