craftr-build-4.x
craftr-build-4.x copied to clipboard
Update command-line interface
Currently the Craftr CLI makes heavy use of flags to allow the incorparation of multiple steps. Most commonly --configure
and --build
is mixed. But positional arguments can not be properly specified for in a multi-staged command. Currently there is only --build
and --clean
for which it makes sense to take the same positional arguments if both are used at the same time, but if we introduce new stages which use different positional arguments, combining them in a single command becomes difficult.
Positional arguments in the Craftr CLI should be context sensitive depending on previously specified flags. For example, after --configure
you should be able to specify options, but after --build
or --clean
you should be able to specify targets. Example:
craftr -configure osx:minversion=10.11 -build main:cxx.run -clean @build
It should also be possible to more easily group arguments for stages, eg. when specifying additional flags for the ninja backend:
craftr -ninja [ -v ] -build
(The spaces around -v
should not matter)