diff options
author | shirleyquirk | 2020-08-04 23:54:04 +0000 |
---|---|---|
committer | GitHub | 2020-08-04 23:54:04 +0000 |
commit | 22799b2e439d6b74ca648060faa1e3f1ee13f946 (patch) | |
tree | 512a18c53d4e7e6878ea134a2a307e3caec2278d /src/main.nim | |
parent | b2321b0ded6f4a9803daf9dbcbd88d56321a9305 (diff) | |
parent | 731f8d7692bfe08f5fd5890a98797f9b1b8d065d (diff) |
Merge pull request #1 from shirleyquirk/collect
Collect
Diffstat (limited to 'src/main.nim')
-rw-r--r-- | src/main.nim | 11 |
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], |