anchor.diff:                   "[var=value,...] <command,...>",
                    [{"var=value", "rebar global variables (e.g. force=1)"},
                     {"command", "Command to run (e.g. compile)"}]).
  +
  +%%
  +%% print known commands
  +%%
  +commands() ->
  +    io:format(<<
  +"analyze                              Analyze with Dialyzer~n"
  +"build_plt                            Build Dialyzer PLT~n"
  +"check_plt                            Check Dialyzer PLT~n"
  +"~n"
  +"clean                                Clean~n"
  +"compile                              Compile sources~n"
  +"~n"
  +"create      template= [var=foo,...]  Create skel based on template and vars~n"
  +"create-app                           Create simple app skel~n"
  +"create-node                          Create simple node skel~n"
  +"~n"
  +"generate    [dump_spec=0/1]          Build release with reltool~n"
  +"install     [target=]                Install build into target~n"
  +"~n"
  +"eunit       [suite=foo]              Run eunit [test/foo_tests.erl] tests~n"
  +"~n"
  +"int_test    [suite=] [case=]         Run ct suites in ./int_test~n"
  +"perf_test   [suite=] [case=]         Run ct suites in ./perf_test~n"
  +"test        [suite=] [case=]         Run ct suites in ./test~n"
  +>>).
   
   %%
   %% options accepted via getopt
  
positive.code:         [Jobs]),
      [
       %% {Name, ShortOpt, LongOpt, ArgSpec, HelpMsg}
       {help,    $h, "help",    undefined, "Show the program options"},
       {verbose, $v, "verbose", undefined, "Be verbose about what gets done"},
       {force,   $f, "force",   undefined, "Force"},
       {jobs,    $j, "jobs",    integer, JobsHelp}
      ].
  
  %%
  
negative.code:     rebar_config:set_global(Flag, Value).
  
  %%
  %% print help
  %%
  print_help_maybe_halt(Options, NonOptArgs) ->
      case proplists:get_bool(help, Options) of
          true ->
              help(),
              halt(0);
          false ->
              case proplists:get_bool(commands, Options) of
                  true ->
                      commands(),
                      halt(0);
                  false ->
                      case NonOptArgs of
                          [] ->
                              io:format("No command to run specified!~n"),
                              help(),
                              halt(1);
                          _ ->
                              {ok, continue}
                      end
              end
      end.
  
  %%
  %% print help/usage string
  %%
  help() ->
  