diff options
Diffstat (limited to 'src/libutil/args.hh')
-rw-r--r-- | src/libutil/args.hh | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/libutil/args.hh b/src/libutil/args.hh index 62b9516d8..823d843aa 100644 --- a/src/libutil/args.hh +++ b/src/libutil/args.hh @@ -87,7 +87,9 @@ protected: template<class I> Handler(I * dest) : fun([=](std::vector<std::string> ss) { - if (!string2Int(ss[0], *dest)) + if (auto n = string2Int<I>(ss[0])) + *dest = *n; + else throw UsageError("'%s' is not an integer", ss[0]); }) , arity(1) |