mirror of
https://github.com/NixOS/nix
synced 2025-06-27 21:01:16 +02:00
Get rid of unicode quotes (#1140)
This commit is contained in:
parent
7ee43df862
commit
f78126bfd6
96 changed files with 670 additions and 670 deletions
|
@ -45,7 +45,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()) {
|
||||
|
@ -55,13 +55,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