There are many libraries for that, but I suggest cligen. It is the simplest command line parser I have found across all programming languages.
Re:Nim Community Survey 2019 Results
by s_gourichon on Monday February 24, 2020 @03:05AM
(#22402429)
What if the Nim maintainers made some kind of continuous popularity measurement to let good libraries bubble up? Opens other problems I know, but may fix such scenario and accelerate Nim adoption?
There was an attempt a few months ago, but it was a little weird. But if you just want to find libraries relevant for your task (e.g. parsing the command line), there is https://nimble.directory where all Nim libraries are listed
Re:Nim Community Survey 2019 Results
by greggirwin on Monday February 24, 2020 @07:57PM
(#22410006)
I hadn't seen docopt before, but am curious why you think it's such a bad design.
Re:Nim Community Survey 2019 Results
by alehander42 on Monday February 24, 2020 @05:55AM
(#22403048)
you can try cligen and then argparse https://github.com/iffy/nim-argparse
The examples given so far, are mediocre.
parseopt is incredibly cumbersome.
docopt is an incredibly poor design, that I can’t believe anyone thought this was a good idea.
And failing to have such basic libraries, I realized, this language has a long way to go.
I contemplated building my own library to handle such a need, but why, this doesn’t solve my problem of building something. And if it’s missing such basic libraries, then what else is it missing? The odds were too great, and too risky for me to commit my time to it.