OK lets say I want to be able to call a function like this:
myfunc -param_action_a param_1 param_2 param_3 -param_action_b param_1 -no_param_action_c -no_param_action_d
Now there might be complex interdependencies because:
1. Some actions are compulsory to be specified, maybe one of many or all of many need to be specified when myfunc is called
2. Some actions are optional in any case and myfunc can always be successful without them being specified
3. Some actions are optional but can only be specified when certain other option exists but not otherwise
4. Some actions cannot be specified when certain others are specified and doing so leads to error
5. Some actions need parameters
6. Some actions do not need parameters
7. Some actions have default parameters maybe some or all
8. Some actions have no default parameters
9. The parameters must be validated to ensure that their value is not invalid
Now I have found that there exists these things:
1. parse_args
2. argparse
3. cmdline
4. Just hack a way using arrays and lists
Now I cannot for the life of me figure out the proper way to do this which can satisfy all the above requirements. Only a "proper" solution can do that. I do not have a lot of time to compare and contrast the 4 methods above. Does TCL have a proper solution to the problem I have described? Maybe someone from the TCL creators group can guide me here.
myfunc -param_action_a param_1 param_2 param_3 -param_action_b param_1 -no_param_action_c -no_param_action_d
Now there might be complex interdependencies because:
1. Some actions are compulsory to be specified, maybe one of many or all of many need to be specified when myfunc is called
2. Some actions are optional in any case and myfunc can always be successful without them being specified
3. Some actions are optional but can only be specified when certain other option exists but not otherwise
4. Some actions cannot be specified when certain others are specified and doing so leads to error
5. Some actions need parameters
6. Some actions do not need parameters
7. Some actions have default parameters maybe some or all
8. Some actions have no default parameters
9. The parameters must be validated to ensure that their value is not invalid
Now I have found that there exists these things:
1. parse_args
2. argparse
3. cmdline
4. Just hack a way using arrays and lists
Now I cannot for the life of me figure out the proper way to do this which can satisfy all the above requirements. Only a "proper" solution can do that. I do not have a lot of time to compare and contrast the 4 methods above. Does TCL have a proper solution to the problem I have described? Maybe someone from the TCL creators group can guide me here.