Hi all! Is there a way to use Arg module from basic-cli to create a simple command parser? I understand it is broken right now? https://github.com/roc-lang/roc/issues/5701
The task example uses Arg. Maybe you could do something similar?
readArgs : Task { url: Str, outputPath: Path } [FailedToReadArgs]_
readArgs =
args <- Arg.list |> Task.attempt
when args is
Ok ([ _, first, second, .. ]) ->
Task.ok { url: first, outputPath: Path.fromStr second }
_ ->
Task.err FailedToReadArgs
A simple pattern matching, then. Hope it will cover my needs, thanks!
Last updated: Jul 05 2025 at 12:14 UTC