summaryrefslogtreecommitdiff
path: root/src/option.cc
diff options
context:
space:
mode:
authorJohn Wiegley <johnw@newartisans.com>2012-05-14 21:36:42 -0600
committerJohn Wiegley <johnw@newartisans.com>2012-05-14 21:44:00 -0600
commitf4f3058b8cd75c04080f9b68cb54b9584eafb39f (patch)
treeeca9ca6ceca001209fb93c05b52e21031280d18c /src/option.cc
parent96172669053bbba7263a370f109f70615049a0c6 (diff)
downloadfork-ledger-f4f3058b8cd75c04080f9b68cb54b9584eafb39f.tar.gz
fork-ledger-f4f3058b8cd75c04080f9b68cb54b9584eafb39f.tar.bz2
fork-ledger-f4f3058b8cd75c04080f9b68cb54b9584eafb39f.zip
Switch to using Boost.Format
Diffstat (limited to 'src/option.cc')
-rw-r--r--src/option.cc18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/option.cc b/src/option.cc
index 418980bd..7fcc9e4d 100644
--- a/src/option.cc
+++ b/src/option.cc
@@ -88,9 +88,9 @@ namespace {
}
catch (const std::exception&) {
if (name[0] == '-')
- add_error_context(_("While parsing option '%1'") << name);
+ add_error_context(_f("While parsing option '%1%'") % name);
else
- add_error_context(_("While parsing environent variable '%1'") << name);
+ add_error_context(_f("While parsing environent variable '%1%'") % name);
throw;
}
}
@@ -137,8 +137,8 @@ void process_environment(const char ** envp, const string& tag,
process_option(string("$") + buf, string(buf), scope, q + 1, value);
}
catch (const std::exception&) {
- add_error_context(_("While parsing environment variable option '%1':")
- << *p);
+ add_error_context(_f("While parsing environment variable option '%1%':")
+ % *p);
throw;
}
}
@@ -198,20 +198,20 @@ strings_list process_arguments(strings_list args, scope_t& scope)
op_bool_tuple opt(find_option(scope, opt_name));
if (! opt.first)
- throw_(option_error, _("Illegal option --%1") << name);
+ throw_(option_error, _f("Illegal option --%1%") % name);
if (opt.second && ! value && ++i != args.end() && value == NULL) {
value = (*i).c_str();
DEBUG("option.args", " read option value from arg: " << value);
if (value == NULL)
- throw_(option_error, _("Missing option argument for --%1") << name);
+ throw_(option_error, _f("Missing option argument for --%1%") % name);
}
process_option(string("--") + name,
opt.first->as_function(), scope, value,
string("--") + name);
}
else if ((*i)[1] == '\0') {
- throw_(option_error, _("illegal option -%1") << (*i)[0]);
+ throw_(option_error, _f("illegal option -%1%") % (*i)[0]);
}
else {
DEBUG("option.args", " single-char option");
@@ -222,7 +222,7 @@ strings_list process_arguments(strings_list args, scope_t& scope)
for (char c = (*i)[x]; c != '\0'; x++, c = (*i)[x]) {
op_bool_tuple opt(find_option(scope, c));
if (! opt.first)
- throw_(option_error, _("Illegal option -%1") << c);
+ throw_(option_error, _f("Illegal option -%1%") % c);
option_queue.push_back(op_bool_char_tuple(opt.first, opt.second, c));
}
@@ -234,7 +234,7 @@ strings_list process_arguments(strings_list args, scope_t& scope)
DEBUG("option.args", " read option value from arg: " << value);
if (value == NULL)
throw_(option_error,
- _("Missing option argument for -%1") << o.ch);
+ _f("Missing option argument for -%1%") % o.ch);
}
process_option(string("-") + o.ch, o.op->as_function(), scope, value,
string("-") + o.ch);