markkorput / pycfgr

cfgr is a text-based VPL that separates data from logic
MIT License
1 stars 1 forks source link

argv parser component #4

Open markkorput opened 5 years ago

markkorput commented 5 years ago

Example:

{
  "App": {"started": "#parseargs", "stop": "#exit"},
  "App/Argv": {"on": "#parseargs", "arg": "#singlearg"},
  "App/Argv/Arg": {"on": "#singlearg", "arg": ["-h", "--help"], "action":"#printhelp,#exit"},
  "App/Argv/Arg": {"on": "#singlearg", "arg": ["-v", "--version"], "action":"#printversion,#exit"},
  "App/Argv/Arg": {"on": "#singlearg", "arg": ["-i", "--id"], "value":"#idvalue"},
  "App/SomRandomObjectTheRequiresAnId": {"id": [0,"#idvalue"]}
}