Closed fkollmann closed 7 months ago
I don't really think this belongs in clap
itself. There are endless niche ways one might want to provide default values. clap
answer to that is to just let the programmer create that themselfs. Anything from res.args.@"worker-count" orelse 4
to res.args.@"worker-count" orelse { <complicated logic goes here> }
.
I suggest just creating a function that gets an enviorment variable and parses it as an int. Then do res.args.@"worker-count" orelse intEnv("WORKER_COUNT") orelse 4
or whatever you come up with.
Please add support for environment variables, when specified as upper-case names without any '-' or '--' prefix.
Example:
The name of the environment variable is
WORKER_COUNT
.When running micro services within our k8s infrastructure, we usually provide arguments using environment variables.