aboutsummaryrefslogtreecommitdiff
path: root/src/common.nim
diff options
context:
space:
mode:
authorkitsunyan2018-04-29 13:44:59 +0000
committerkitsunyan2018-04-29 13:44:59 +0000
commit9525d77603309b81faa43b14137b0a48f7391850 (patch)
tree3d8d2ec858681606c2ec5b5228529208dda91039 /src/common.nim
parent34fb7795b12ad3aade4905438f44c9be95d9d501 (diff)
Simplify arguments checking
Diffstat (limited to 'src/common.nim')
-rw-r--r--src/common.nim4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/common.nim b/src/common.nim
index 92c850d..b66237a 100644
--- a/src/common.nim
+++ b/src/common.nim
@@ -38,7 +38,7 @@ type
]
proc checkAndRefresh*(color: bool, args: seq[Argument]): tuple[code: int, args: seq[Argument]] =
- let refreshCount = args.count((some("y"), "refresh"))
+ let refreshCount = args.count(%%%"refresh")
if refreshCount > 0:
let code = pacmanRun(true, color, args
.keepOnlyOptions(commonOptions, upgradeCommonOptions) &
@@ -46,7 +46,7 @@ proc checkAndRefresh*(color: bool, args: seq[Argument]): tuple[code: int, args:
("y", none(string), ArgumentType.short).repeat(refreshCount))
let callArgs = args
- .filter(arg => not arg.matchOption((some("y"), "refresh")))
+ .filter(arg => not arg.matchOption(%%%"refresh"))
(code, callArgs)
else:
(0, args)