cligen (https://github.com/c-blake/cligen/)
how can i do:
./proc call "1. positional required" "2. positional required" "3. positional optional"
# eg: ./proc call "*" "cmd.ping"
# eg: ./proc call "*" "os.shell" "ifconfig" --json
proc call(target: string, command: string, params = "", json = false): int =
echo "e keys"
#...
and
./proc firstSubCmd secondSubCmd thirdSubCmd
# eg: ./proc keys list
# eg: ./proc keys list accepted
i wonder if this is possible with cligen.
At present your best bet for your first style is to just have the wrapped proc receive a seq[string] and just test it yourself. Note though, that you aren't really getting much value out of any option parsing framework vs. just using os.cmdLineParams().
While it could be more elegant/automatic, the second thing you ask about works fine with the current cligen as shown by test/MultMultMult.nim in the cligen repo.