aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-20 01:22:57 +0000
committerAvatar Ciaran McCreesh <ciaran.mccreesh@googlemail.com> 2006-01-20 01:22:57 +0000
commitd4c753da4aed36e3d3a9433e4aa9dad273a5e0bf (patch)
tree2a33d6af1767c61e4a94118b791846d6ac184ed7
parent9ded15bf7720d70e0a0f3cb9d00fe244c7e2caad (diff)
downloadpaludis-d4c753da4aed36e3d3a9433e4aa9dad273a5e0bf.tar.gz
paludis-d4c753da4aed36e3d3a9433e4aa9dad273a5e0bf.tar.xz
Minor coding style tweaks
-rw-r--r--paludis/args/args_dumper.cc2
-rw-r--r--paludis/args/args_handler.cc8
-rw-r--r--paludis/args/args_option.cc6
-rw-r--r--paludis/args/args_visitor.cc4
4 files changed, 8 insertions, 12 deletions
diff --git a/paludis/args/args_dumper.cc b/paludis/args/args_dumper.cc
index 3619b6e..67f68ec 100644
--- a/paludis/args/args_dumper.cc
+++ b/paludis/args/args_dumper.cc
@@ -56,7 +56,7 @@ VISIT(AliasArg)
void ArgsDumper::visit(const EnumArg * const a)
{
visit(static_cast<const ArgsOption *>(a));
- for(EnumArg::AllowedArgIterator it = a->begin_allowed_args(), it_end = a->end_allowed_args();
+ for (EnumArg::AllowedArgIterator it = a->begin_allowed_args(), it_end = a->end_allowed_args();
it != it_end; ++it)
{
std::stringstream p;
diff --git a/paludis/args/args_handler.cc b/paludis/args/args_handler.cc
index 16428b6..18b1f47 100644
--- a/paludis/args/args_handler.cc
+++ b/paludis/args/args_handler.cc
@@ -67,19 +67,17 @@ ArgsHandler::run(const int argc, const char * const * const argv)
{
arg.erase(0, 2);
std::map<std::string, ArgsOption*>::iterator it = _longopts.find(arg);
- if(it == _longopts.end())
- {
+ if (it == _longopts.end())
throw BadArgument("--" + arg);
- }
(*it).second->accept(&visitor);
}
else if (arg[0] == '-')
{
arg.erase(0, 1);
- for(std::string::iterator c = arg.begin(); c != arg.end(); ++c)
+ for (std::string::iterator c = arg.begin(); c != arg.end(); ++c)
{
std::map<char, ArgsOption*>::iterator it = _shortopts.find(*c);
- if(it == _shortopts.end())
+ if (it == _shortopts.end())
{
throw BadArgument(std::string("-") + *c);
}
diff --git a/paludis/args/args_option.cc b/paludis/args/args_option.cc
index 72311d0..63ffcd5 100644
--- a/paludis/args/args_option.cc
+++ b/paludis/args/args_option.cc
@@ -53,16 +53,16 @@ SwitchArg::SwitchArg(ArgsGroup * const group, std::string long_name, char short_
}
IntegerArg::IntegerArg(ArgsGroup * const group, const std::string& long_name,
- char short_name, const std::string& description) :
+ char short_name, const std::string& description) :
ArgsOption(group, long_name, short_name, description)
{
}
void EnumArg::set_argument(const std::string & arg)
{
- if(_allowed_args.find(arg) == _allowed_args.end())
+ if (_allowed_args.find(arg) == _allowed_args.end())
{
- throw(BadValue("--" + long_name(), arg));
+ throw (BadValue("--" + long_name(), arg));
}
_argument = arg;
}
diff --git a/paludis/args/args_visitor.cc b/paludis/args/args_visitor.cc
index d3648d1..cfc02b6 100644
--- a/paludis/args/args_visitor.cc
+++ b/paludis/args/args_visitor.cc
@@ -60,10 +60,8 @@ void ArgsVisitor::visit(IntegerArg * const arg)
ss << param;
int i;
ss >> i;
- if(!ss.eof() || ss.bad())
- {
+ if (!ss.eof() || ss.bad())
throw BadValue("--" + arg->long_name(), param);
- }
arg->set_argument(i);
}