diff options
| author | Julian Andres Klode <julian.klode@canonical.com> | 2024-04-19 16:18:57 +0200 |
|---|---|---|
| committer | Julian Andres Klode <julian.klode@canonical.com> | 2024-04-19 17:06:45 +0200 |
| commit | be5289525a2a037881eaac48fbab26f864f72cd5 (patch) | |
| tree | 1ceeea33e787e65d8177f3aee645521d586fc848 /apt-private | |
| parent | dc779ff0a33d9da8bc55390ee55ad73d31739e46 (diff) | |
Add a --color, --no-color option
Wrap empty else in {} to avoid readability issues
Diffstat (limited to 'apt-private')
| -rw-r--r-- | apt-private/private-cmndline.cc | 7 | ||||
| -rw-r--r-- | apt-private/private-moo.cc | 2 |
2 files changed, 4 insertions, 5 deletions
diff --git a/apt-private/private-cmndline.cc b/apt-private/private-cmndline.cc index 9b84f2dd5..e0e00c917 100644 --- a/apt-private/private-cmndline.cc +++ b/apt-private/private-cmndline.cc @@ -246,10 +246,8 @@ static bool addArgumentsAPTGet(std::vector<CommandLine::Args> &Args, char const } else if (CmdMatches("clean", "autoclean", "auto-clean", "distclean", "dist-clean", "check", "download", "changelog") || CmdMatches("markauto", "unmarkauto")) // deprecated commands - ; - else if (CmdMatches("moo")) - addArg(0, "color", "APT::Moo::Color", 0); - + { + } if (CmdMatches("install", "reinstall", "remove", "purge", "upgrade", "dist-upgrade", "dselect-upgrade", "autoremove", "auto-remove", "autopurge", "check", "clean", "autoclean", "auto-clean", "distclean", "dist-clean", @@ -409,6 +407,7 @@ std::vector<CommandLine::Args> getCommandArgs(APT_CMD const Program, char const addArg('h', "help", "help", 0); addArg('v', "version", "version", 0); // general options + addArg(0, "color", "APT::Color", 0); addArg('q', "quiet", "quiet", CommandLine::IntLevel); addArg('q', "silent", "quiet", CommandLine::IntLevel); addArg('c', "config-file", 0, CommandLine::ConfigFile); diff --git a/apt-private/private-moo.cc b/apt-private/private-moo.cc index 2a9ed9391..5eb6db56a 100644 --- a/apt-private/private-moo.cc +++ b/apt-private/private-moo.cc @@ -96,7 +96,7 @@ static bool DoMoo2(time_t const timenow) /*{{{*/ return printMooLine(timenow); std::string const moo = getMooLine(timenow); size_t const depth = moo.length()/4; - if (_config->FindB("APT::Moo::Color", false) == false) + if (_config->FindB("APT::Color", false) == false) c1out << OutputInDepth(depth, " ") << " (__) \n" << OutputInDepth(depth, " ") << " _______~(..)~ \n" << |
