Code sprint: pkg.m: Difference between revisions

Jump to navigation Jump to search
Line 13: Line 13:


= Parsing arguments passed to pkg =
= Parsing arguments passed to pkg =
One of the most intimidating parts of pkg.m is the monstrous way the parsing of arguments is done. The current mayhem is probably due to the natural evolution of the code.
the method use to parse the arguments is based on a flag system.
We started cleaning up the parsing of options to give some structure and make pkg.m easy to extend in the future. For this we focus on encapsulation.
== Definitions of actions, targets and modifiers ==
A typical call to pkg looks like
  pkg install -forge pkg1 pkg2 pkg3 -j4
We can identify three types of input arguments
* Action: install
* Modifiers: -forge, -j4
* Targets: pkg1, pkg2, pk3
So far we have defined them as follows
* Action: The first input argument and can't start with a hyphen.
* Modifier: Must start with a hyphen.
* Target: Anything that is not an action nor a modifier
== Dispatching ==


= Desired features =
= Desired features =