There is a way to reproduce C command line arguments behavior in Julia?
int main(int argc, char **argv) { /* ... */ }
There is a way to reproduce C command line arguments behavior in Julia?
int main(int argc, char **argv) { /* ... */ }
I used DocOpt.jl in the past and liked it. But I remember a newer approach as well. If I remember the link I will share here.
Here it is: https://github.com/comonicon/Comonicon.jl
At the lowest level, the equivalent of the C argc
/argv
variables is the ARGS
global constant, which is a list of strings giving the command-line arguments passed by the user.
On top of that, there are various higher-level packages to help you parse command-line arguments. For example, an analogue of the C getopt
API in Julia is provided by the ArgParse package, and then there are also the abovementioned DocOpt and Comonicon packages.