aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar David Leverton <levertond@googlemail.com> 2008-10-25 17:06:32 +0100
committerAvatar David Leverton <levertond@googlemail.com> 2008-10-25 17:06:32 +0100
commit034aa1f7f1955968397738578ba8aad623a6e8b5 (patch)
tree0559a14a98827233cb5c0edcf80e4a8721a900be
parent449407a1969aa279b26929d57e25da41e81dafc6 (diff)
downloadpaludis-034aa1f7f1955968397738578ba8aad623a6e8b5.tar.gz
paludis-034aa1f7f1955968397738578ba8aad623a6e8b5.tar.xz
Support cave --log-level
-rw-r--r--src/clients/cave/cave.cc2
-rw-r--r--src/clients/cave/command_line.cc5
-rw-r--r--src/clients/cave/command_line.hh2
3 files changed, 7 insertions, 2 deletions
diff --git a/src/clients/cave/cave.cc b/src/clients/cave/cave.cc
index 4d6e7b2..f863bae 100644
--- a/src/clients/cave/cave.cc
+++ b/src/clients/cave/cave.cc
@@ -47,6 +47,8 @@ int main(int argc, char * argv[])
if (cmdline.begin_parameters() == cmdline.end_parameters())
throw args::DoHelp();
+ Log::get_instance()->set_program_name(argv[0]);
+ Log::get_instance()->set_log_level(cmdline.a_log_level.option());
std::tr1::shared_ptr<Environment> env(EnvironmentFactory::get_instance()->create(cmdline.a_environment.argument()));
std::tr1::shared_ptr<Sequence<std::string> > seq(new Sequence<std::string>);
diff --git a/src/clients/cave/command_line.cc b/src/clients/cave/command_line.cc
index 56468e8..76cf97b 100644
--- a/src/clients/cave/command_line.cc
+++ b/src/clients/cave/command_line.cc
@@ -25,8 +25,9 @@ using namespace cave;
CaveCommandLine::CaveCommandLine() :
g_global_options(this, "Global Options", "Global options, used by every subcommand."),
a_environment(&g_global_options, "environment", 'E',
- "Environment specification (class:suffix, both parts optional)")
+ "Environment specification (class:suffix, both parts optional)"),
+ a_log_level(&g_global_options, "log-level", '\0')
{
- add_usage_line("[ --environment class:suffix ] COMMAND [ARGS...]");
+ add_usage_line("[ --environment class:suffix ] [ --log-level level ] COMMAND [ARGS...]");
}
diff --git a/src/clients/cave/command_line.hh b/src/clients/cave/command_line.hh
index 7b77a78..7e000c1 100644
--- a/src/clients/cave/command_line.hh
+++ b/src/clients/cave/command_line.hh
@@ -21,6 +21,7 @@
#define PALUDIS_GUARD_SRC_CLIENTS_CAVE_COMMAND_LINE_HH 1
#include <paludis/args/args_handler.hh>
+#include <paludis/args/log_level_arg.hh>
namespace paludis
{
@@ -46,6 +47,7 @@ namespace paludis
args::ArgsGroup g_global_options;
args::StringArg a_environment;
+ args::LogLevelArg a_log_level;
CaveCommandLine();
};