diff options
author | Michael Vogt <mvo@debian.org> | 2014-01-17 08:43:14 +0100 |
---|---|---|
committer | Michael Vogt <mvo@debian.org> | 2014-01-17 08:43:14 +0100 |
commit | 1410955589dc9f0eaa290907cac070b7ebf93b6a (patch) | |
tree | ea69d4dcb856d793a0dcfad0176e40987655c1dd /cmdline | |
parent | b7159ec8835e61ea3069213d9188be91c109e32c (diff) |
add missing integration test for "apt list"
Diffstat (limited to 'cmdline')
-rw-r--r-- | cmdline/apt.cc | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/cmdline/apt.cc b/cmdline/apt.cc index 2d3966e86..8dc4c292a 100644 --- a/cmdline/apt.cc +++ b/cmdline/apt.cc @@ -114,16 +114,6 @@ int main(int argc, const char *argv[]) /*{{{*/ std::vector<CommandLine::Args> Args = getCommandArgs("apt", CommandLine::GetCommand(Cmds, argc, argv)); - if(!isatty(1)) - { - std::cerr << std::endl - << "WARNING: " << argv[0] << " " - << "does not have a stable CLI interface yet. " - << "Use with caution in scripts." - << std::endl - << std::endl; - } - InitOutput(); // Set up gettext support @@ -149,6 +139,19 @@ int main(int argc, const char *argv[]) /*{{{*/ return 100; } + if(!isatty(STDOUT_FILENO) && + _config->FindB("Apt::Cmd::Disable-Script-Warning", false) == false) + { + std::cerr << std::endl + << "WARNING: " << argv[0] << " " + << "does not have a stable CLI interface yet. " + << "Use with caution in scripts." + << std::endl + << std::endl; + } + if (!isatty(STDOUT_FILENO) && _config->FindI("quiet", -1) == -1) + _config->Set("quiet","1"); + // See if the help should be shown if (_config->FindB("help") == true || _config->FindB("version") == true || |