mirror of
https://github.com/NixOS/nix
synced 2025-06-27 21:01:16 +02:00
Use proper quotes everywhere
This commit is contained in:
parent
373fad75e1
commit
11849a320e
54 changed files with 548 additions and 543 deletions
|
@ -46,7 +46,7 @@ template<class N> N getIntArg(const string & opt,
|
|||
Strings::iterator & i, const Strings::iterator & end, bool allowUnit)
|
||||
{
|
||||
++i;
|
||||
if (i == end) throw UsageError(format("`%1%' requires an argument") % opt);
|
||||
if (i == end) throw UsageError(format("‘%1%’ requires an argument") % opt);
|
||||
string s = *i;
|
||||
N multiplier = 1;
|
||||
if (allowUnit && !s.empty()) {
|
||||
|
@ -56,13 +56,13 @@ template<class N> N getIntArg(const string & opt,
|
|||
else if (u == 'M') multiplier = 1ULL << 20;
|
||||
else if (u == 'G') multiplier = 1ULL << 30;
|
||||
else if (u == 'T') multiplier = 1ULL << 40;
|
||||
else throw UsageError(format("invalid unit specifier `%1%'") % u);
|
||||
else throw UsageError(format("invalid unit specifier ‘%1%’") % u);
|
||||
s.resize(s.size() - 1);
|
||||
}
|
||||
}
|
||||
N n;
|
||||
if (!string2Int(s, n))
|
||||
throw UsageError(format("`%1%' requires an integer argument") % opt);
|
||||
throw UsageError(format("‘%1%’ requires an integer argument") % opt);
|
||||
return n * multiplier;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue