summaryrefslogtreecommitdiff
path: root/u/process/argv.ts
diff options
context:
space:
mode:
authorElizabeth Hunt <me@liz.coffee>2025-06-29 17:42:37 -0700
committerElizabeth Hunt <me@liz.coffee>2025-06-29 17:42:37 -0700
commit4daf12199a8ca0666b2f37e8d0c755b94cf1ea63 (patch)
treee6436a5026b437f793752e173f6237911605547a /u/process/argv.ts
parent58be1809c46cbe517a18d86d0af52179dcc5cbf6 (diff)
downloadci-4daf12199a8ca0666b2f37e8d0c755b94cf1ea63.tar.gz
ci-4daf12199a8ca0666b2f37e8d0c755b94cf1ea63.zip
Minor fixes to argv parsing and docker base image
Diffstat (limited to 'u/process/argv.ts')
-rw-r--r--u/process/argv.ts4
1 files changed, 3 insertions, 1 deletions
diff --git a/u/process/argv.ts b/u/process/argv.ts
index dca5098..396fa96 100644
--- a/u/process/argv.ts
+++ b/u/process/argv.ts
@@ -31,7 +31,9 @@ export const getArg = <K extends string, V>(
.flatMap((idx) =>
Optional.from(argv.at(idx)).map((_argv) => (_argv.includes('=') ? _argv.split('=')[1] : argv.at(idx + 1))),
)
- .map((next) => (isArgKey(next) ? whenValue.unspecified : whenValue.present(next)))
+ .filter((next) => !isArgKey(next))
+ .map((next) => whenValue.present(next))
+ .orSome(() => whenValue.unspecified)
.map((v) => Either.right<Error, V>(<V>v))
.get();
};