aboutsummaryrefslogtreecommitdiff
path: root/src/main.nim
diff options
context:
space:
mode:
authorshirleyquirk2020-08-04 23:54:04 +0000
committerGitHub2020-08-04 23:54:04 +0000
commit22799b2e439d6b74ca648060faa1e3f1ee13f946 (patch)
tree512a18c53d4e7e6878ea134a2a307e3caec2278d /src/main.nim
parentb2321b0ded6f4a9803daf9dbcbd88d56321a9305 (diff)
parent731f8d7692bfe08f5fd5890a98797f9b1b8d065d (diff)
Merge pull request #1 from shirleyquirk/collect
Collect
Diffstat (limited to 'src/main.nim')
-rw-r--r--src/main.nim11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/main.nim b/src/main.nim
index 3de4a65..87bb8d2 100644
--- a/src/main.nim
+++ b/src/main.nim
@@ -11,8 +11,15 @@ import
"feature/syncsource"
proc execSudo*(args: seq[Argument]): int =
- execResult(sudoPrefix & getAppFilename() &
- lc[x | (y <- args, x <- y.collectArg), string])
+ when NimVersion >= "1.2":
+ execResult(sudoPrefix & getAppFilename() & (block:collect(newSeq):
+ for y in args:
+ for x in y.collectArg:
+ x
+ ))
+ else:
+ execResult(sudoPrefix & getAppFilename() &
+ lc[x | (y <- args, x <- y.collectArg), string])
proc passValidation(args: seq[Argument], config: Config,
nonRootArgs: openArray[OptionPair], rootArgs: openArray[OptionPair],