diff options
| author | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-12-03 16:30:00 +0900 |
|---|---|---|
| committer | Tatsuhiro Tsujikawa <tatsuhiro.t@gmail.com> | 2011-12-03 16:30:00 +0900 |
| commit | 6bf696ca112c0ce061fb1b6a351dd2227fbedb67 (patch) | |
| tree | fa091b84f4bad0dd3818a10d7d988f1412f1cec1 /src/OptionHandlerException.cc | |
| parent | f77da0d11202ad42d10989c48403dddfcbb34796 (diff) | |
New help messages. Added suggestion for unknown/ambiguous options.
The help messages shown when argument error were redesigned and less
verbose now. When unknown or ambiguous option is given, show
suggestions like "Did you mean...". Some constant values related to
levenstein distance are borrowed from git help.c.
Diffstat (limited to 'src/OptionHandlerException.cc')
| -rw-r--r-- | src/OptionHandlerException.cc | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/OptionHandlerException.cc b/src/OptionHandlerException.cc index 59cb7667..eb740e5b 100644 --- a/src/OptionHandlerException.cc +++ b/src/OptionHandlerException.cc @@ -38,15 +38,16 @@ namespace aria2 { -const std::string OptionHandlerException::MESSAGE -("We encountered a problem while processing the option '--%s'."); +namespace { +const char* MESSAGE = + _("We encountered a problem while processing the option '--%s'."); +} // namespace OptionHandlerException::OptionHandlerException (const char* file, int line, const Pref* pref) : RecoverableException - (file, line, fmt(MESSAGE.c_str(), pref->k), - error_code::OPTION_ERROR), + (file, line, fmt(MESSAGE, pref->k), error_code::OPTION_ERROR), pref_(pref) {} @@ -55,8 +56,7 @@ OptionHandlerException::OptionHandlerException const Pref* pref, const Exception& cause) : RecoverableException - (file, line, fmt(MESSAGE.c_str(), pref->k), - error_code::OPTION_ERROR, + (file, line, fmt(MESSAGE, pref->k), error_code::OPTION_ERROR, cause), pref_(pref) {} |
