I think it depends a lot on how you parse the arguments in your program.
Here are some examples of how programs accept multiple key-value pairs.
man php:
--define foo[=bar] -d foo[=bar] Define INI entry foo with value bar
man git:
-c <name>=<value> Pass a configuration parameter to the command. The value given will override values from configuration files. The <name> is expected in the same format as listed by git config (subkeys separated by dots).
For both, you can pass multiple -d or -c arguments to programs that give you the opportunity to provide a list of key-value pairs for programs.
IMO, this is not a big problem when you have your own style of receiving lists of key-value pairs for your program while it works and is well documented. :)
PS: I think this question would be more appropriate to be posted on the Stack Exchange program , and not on SO. See here and here .
cychoi
source share