January 2019
Intermediate to advanced
520 pages
14h 32m
English
Environment variables are useful for using with containers. If you use your application from a console or you want to avoid a conflict of names with other variables, you can use command-line parameters. This is a more conventional way for developers to set parameters to the program.
You can also get command-line arguments with the env module. This contains the args function, which returns an Args object. This object is not an array or vector, but it's iterable and you can use the for loop processes all command-line arguments:
for arg in env::args() { // Interpret the arg here }
This variant may come in handy in simple cases. For parsing arguments with complex rules, however, you have to use a command-line argument ...
Read now
Unlock full access