2

I have a lot of rules i'm generating via calling functions with parameters (similar rules that vary slightly depending on which project to build) and when no parameters are passed or a "show_all" is passed as a target I'd like to list out all the generated rules.

How can I do that or is it impossible?

sbditto85
  • 1,485
  • 14
  • 21

1 Answers1

1

Using Shake v0.17.6 you can run --help which prints out something like:

Usage: my-shake-builder [options] [target] ...

Standard options:
  -a FULL=SHORT, --abbrev=FULL=SHORT
                              Use abbreviation in status messages.
  ... snip ...
  --no-print-directory        Turn off -w, even if it was turned on implicitly.

Extra options:
  --clean                     Clean before building.
  --sleep                     Pause before executing.
  --usepredicate              Use &?> in preference to &%>

Targets:
  - Main.exe
  - **/*.deps
  - **/*.dep
  - **/*.o
  - **/*.hi
  - .pkgs

By default all rules with a name or pattern, e.g. phony, %>, &%> etc, are added as names, but you can control that through the addTarget function. You can get a list or targets by passing --help or using the function getTargets (which is what --help uses under the hood).

Neil Mitchell
  • 9,090
  • 1
  • 27
  • 85