gecko-dev/python/mach
Nick Alexander aaeaaec3dc Bug 1521996 - Part 1: Add `conditional_name` to mach @Command definition. r=ahal
We want `mach run` for Android to be wildly different than `mach run`
for Desktop.  But right now, mach really doesn't support two different
implementations of the same underlying named command.  The avenues
that might support different implementations, mostly run through
`conditions`.

`conditions` were added to mach commands in Bug 901972, and never
really anticipated this use case: commands are keyed by name condition
evaluation is delayed until dispatch-time.  In order to have different
commands with the same name, and have full support for `--help`,
command matching, suggestions, etc, we really need conditions to
evaluate at parse-time.  Indeed, since Bug 901972 landed, we've moved
context creation earlier in the dispatch flow and hacked in things
that look like parse-time conditions (see Bug 1291335 and Bug
1305695).

This approach is not the prettiest, but it handles this narrow
use-case -- making `mach run` and `mach install` different on Android
-- without much code churn.

Differential Revision: https://phabricator.services.mozilla.com/D18290

--HG--
extra : moz-landing-system : lando
2019-05-17 21:39:31 +00:00
..
docs Bug 1519968 - [mach] Minor improvements to autocomplete docs, r=jmaher 2019-01-14 19:43:53 +00:00
mach Bug 1521996 - Part 1: Add `conditional_name` to mach @Command definition. r=ahal 2019-05-17 21:39:31 +00:00
README.rst
bash-completion.sh Bug 1518586 - [mach] Implement bash completion for subcommands and arguments r=nalexander 2019-01-11 15:28:49 +00:00
setup.py Backed out 3 changesets (bug 1388013) for build bustages e.g. ../python/mozbuild/mozpack/test/test_files.py on a CLOSED TREE 2018-05-31 11:48:19 +03:00

README.rst

====
mach
====

Mach (German for *do*) is a generic command dispatcher for the command
line.

To use mach, you install the mach core (a Python package), create an
executable *driver* script (named whatever you want), and write mach
commands. When the *driver* is executed, mach dispatches to the
requested command handler automatically.

To learn more, read the docs in ``docs/``.