예제 #1
0
def help_command(
        on=False, # Provide a command name to get help for an individual command.
        scraper=False, # Provide a scraper alias to get help for an individual scraper.
        report=False, # Provide a report alias to get help for an individua lreport.
        ):
    """
    Command line documentation for the oacensus tool.

    Examples:

    `oacensus help -on run`
    `oacensus help -scraper oag`
    `oacensus help -report excel`
    """
    print ""
    if on:
        args.help_command(prog, mod, default_cmd, on)
    elif scraper:
        if scraper in Scraper.plugins:
            print "%s Scraper" % scraper
            instance = Scraper.create_instance(scraper)
            print_help_for_instance(instance)
        else:
            print "No scraper or report matching alias %s was found." % scraper
            sys.exit(1)
    elif report:
        if report in Report.plugins:
            print "%s Report" % report
            instance = Report.create_instance(report)
            print_help_for_instance(instance)
        else:
            print "No scraper or report matching alias %s was found." % report
            sys.exit(1)
    else:
        print main_help
예제 #2
0
파일: __init__.py 프로젝트: stephenhay/dexy
def help_command(
    all=False,  # List all available dexy commands (auto-generated).
    on=False  # Get help on a particular dexy command.
):

    if all and not on:
        print ""
        args.help_command(prog, dexy_cmd_mod, dexy_default_cmd, on)
        print ""

    elif not on:
        print ""
        print "For help on the main `dexy` command, run `dexy help -on dexy`."
        print ""
        print "The dexy tool includes several different commands:"
        print "  `dexy help --all` lists all available commands"
        print "  `dexy help --on XXX` provides help on a specific command"
        print ""
        print "Commands for running dexy:"
        print "  `dexy` runs dexy"
        print "  `dexy setup` makes directories dexy needs"
        print "  `dexy cleanup` removes directories dexy has created"
        print "  `dexy reset` empties and resets dexy's working directories"
        print ""
        print "Commands which print lists of dexy features:"
        print "  `dexy filters` filters like |jinja |py |javac"
        print "  `dexy reports` reporters like `output` and `run`"
        print "  `dexy nodes` node types and their document settings"
        print "  `dexy datas` data types and available methods"
        print "  `dexy env` elements available in document templates"
        print ""
        print "Commands which print information about your project:"
        print "  (you need to be in the project dir and have run dexy already)"
        print "  `dexy grep` search for documents and keys in documents"
        print "  `dexy info` list metadata about a particular document"
        print "  `dexy targets` list target names you can run"
        print "  `dexy links` list all ways to refer to documents and sections"
        print ""
        print "Other commands:"
        print "  `dexy serve` start a local static web server to view generated docs"
        print "  `dexy help` you're reading it"
        print "  `dexy version` print the version of dexy software which is installed"
        print ""

    else:
        try:
            args.help_command(prog, dexy_cmd_mod, dexy_default_cmd, on)

        except KeyError:
            sys.stderr.write("Could not find help on '%s'." % on)
            sys.stderr.write(os.linesep)
            sys.exit(1)
예제 #3
0
파일: __init__.py 프로젝트: GWhized/dexy
def help_command(
    all=False, on=False  # List all available dexy commands (auto-generated).  # Get help on a particular dexy command.
):

    if all and not on:
        print ""
        args.help_command(prog, dexy_cmd_mod, dexy_default_cmd, on)
        print ""

    elif not on:
        print ""
        print "For help on the main `dexy` command, run `dexy help -on dexy`."
        print ""
        print "The dexy tool includes several different commands:"
        print "  `dexy help --all` lists all available commands"
        print "  `dexy help --on XXX` provides help on a specific command"
        print ""
        print "Commands for running dexy:"
        print "  `dexy` runs dexy"
        print "  `dexy setup` makes directories dexy needs"
        print "  `dexy cleanup` removes directories dexy has created"
        print "  `dexy reset` empties and resets dexy's working directories"
        print ""
        print "Commands which print lists of dexy features:"
        print "  `dexy filters` filters like |jinja |py |javac"
        print "  `dexy reports` reporters like `output` and `run`"
        print "  `dexy nodes` node types and their document settings"
        print "  `dexy datas` data types and available methods"
        print "  `dexy env` elements available in document templates"
        print ""
        print "Commands which print information about your project:"
        print "  (you need to be in the project dir and have run dexy already)"
        print "  `dexy grep` search for documents and keys in documents"
        print "  `dexy info` list metadata about a particular document"
        print "  `dexy targets` list target names you can run"
        print "  `dexy links` list all ways to refer to documents and sections"
        print ""
        print "Other commands:"
        print "  `dexy serve` start a local static web server to view generated docs"
        print "  `dexy help` you're reading it"
        print "  `dexy version` print the version of dexy software which is installed"
        print ""

    else:
        try:
            args.help_command(prog, dexy_cmd_mod, dexy_default_cmd, on)

        except KeyError:
            sys.stderr.write("Could not find help on '%s'." % on)
            sys.stderr.write(os.linesep)
            sys.exit(1)
예제 #4
0
def help_command(
        example=False, # Whether to run any live examples, if available.
        filters=False, # Whether to print the list of available dexy filters.
        reports=False, # Whether to print the list of available dexy reports.
        f=False, # If a filter alias is specified, help for that filter is printed.
        on=False # The dexy command to get help on.
    ):
    # TODO list plugin commands too when -on not specified
    if f:
        filter_command(f, example)
    elif filters:
        filters_command()
    elif reports:
        reports_command()
    else:
        args.help_command(PROG, MOD, DEFAULT_COMMAND, on)
예제 #5
0
def help_command(on=False):
    args.help_command(PROG, MOD, DEFAULT_COMMAND, on)
예제 #6
0
def help_command(on=False):
    """
    Prints this help.
    """
    args.help_command(prog, mod, default_cmd, on)
예제 #7
0
파일: screenshot.py 프로젝트: mrflip/dexy
def help_command(on=False):
    args.help_command(PROG, MOD, 'screenshot', on)
예제 #8
0
파일: __init__.py 프로젝트: ananelson/ado
def help_command(on=False):
    """
    Prints this help.
    """
    args.help_command(PROG, MOD, setting("default-command"), on)
예제 #9
0
파일: commands.py 프로젝트: tomspur/dexy
def help_command(on=False):
    args.help_command(PROG, MOD, Constants.DEFAULT_COMMAND, on)