Beispiel #1
0
def get_option_parser():
    """Augment options parser to current context."""
    parser = COP(__doc__, argdoc=[('REG', 'Suite name')], comms=True)

    delta_keys = list(DELTAS_MAP)
    pb_topics = ("Directly published data-store topics include: '" +
                 ("', '").join(delta_keys[:-1]) + "' and '" + delta_keys[-1] +
                 "'.")
    parser.add_option(
        "-T",
        "--topics",
        help="Specify a comma delimited list of subscription topics. " +
        pb_topics,
        action="store",
        dest="topics",
        default='workflow')

    parser.add_option("-o",
                      "--once",
                      help="Show a single publish then exit.",
                      action="store_true",
                      default=False,
                      dest="once")

    return parser
Beispiel #2
0
def get_option_parser():
    parser = COP(__doc__,
                 comms=True,
                 multitask=True,
                 argdoc=[('REG', 'Suite name'),
                         ('[TASK_GLOB ...]', 'Task matching patterns')])

    parser.add_option("-s",
                      "--state",
                      metavar="STATE",
                      help="Reset task state to STATE, can be %s" %
                      (', '.join(TASK_STATUSES_CAN_RESET_TO)),
                      choices=list(TASK_STATUSES_CAN_RESET_TO),
                      action="store",
                      dest="state")

    parser.add_option(
        "--output",
        "-O",
        metavar="OUTPUT",
        help=("Find task output by message string or trigger string, " +
              "set complete or incomplete with !OUTPUT, " +
              "'*' to set all complete, '!*' to set all incomplete. " +
              "Can be used more than once to reset multiple task outputs."),
        action="append",
        default=[],
        dest="outputs")

    return parser
Beispiel #3
0
def get_option_parser():
    parser = COP(
        __doc__,
        comms=True,
        argdoc=[
            ("WORKFLOW_ID", "Workflow ID"),
            ("MSG", "External trigger message"),
            ("TRIGGER_ID", "Unique trigger ID"),
        ],
    )

    parser.add_option("--max-tries",
                      help="Maximum number of send attempts "
                      "(default %s)." % MAX_N_TRIES,
                      metavar="INT",
                      action="store",
                      default=MAX_N_TRIES,
                      dest="max_n_tries")

    parser.add_option("--retry-interval",
                      help="Delay in seconds before retrying "
                      "(default %s)." % RETRY_INTVL_SECS,
                      metavar="SEC",
                      action="store",
                      default=RETRY_INTVL_SECS,
                      dest="retry_intvl_secs")

    return parser
def get_option_parser():
    parser = COP(
        __doc__,
        comms=True,
        multitask=True,
        multiworkflow=True,
        argdoc=[('ID [ID ...]', 'Cycle/Family/Task ID(s)')],
    )

    parser.add_option("-o",
                      "--output",
                      metavar="OUTPUT",
                      help="Set OUTPUT (default \"succeeded\") completed.",
                      action="append",
                      default=None,
                      dest="outputs")

    parser.add_option("-f",
                      "--flow",
                      metavar="FLOW",
                      help="Number of the flow to attribute the outputs.",
                      action="store",
                      default=None,
                      dest="flow_num")

    return parser
def get_option_parser():
    parser = COP(__doc__,
                 argdoc=[('[DIR]', 'Target directory.'),
                         ('[RESOURCES...]',
                          'Resources to extract (default all).')])

    parser.add_option('--list', default=False, action='store_true')

    return parser
Beispiel #6
0
def get_option_parser():
    parser = COP(
        __doc__, comms=True, multitask_nocycles=True,
        argdoc=[
            ("REG", "Workflow name"),
            ('TASK-GLOB [...]', 'Task match pattern')])
    parser.add_option(
        "--output", metavar="OUTPUT",
        help="Set task output OUTPUT completed, defaults to 'succeeded'.",
        action="append", dest="outputs")
    return parser
Beispiel #7
0
def get_option_parser():
    parser = COP(__doc__, comms=True, argdoc=[
        ('WORKFLOW', 'Workflow name or ID'),
        ('METHOD', 'Network API function name')])

    parser.add_option(
        '-n', '--no-input',
        help='Do not read from STDIN, assume null input',
        action='store_true', dest='no_input')

    return parser
Beispiel #8
0
def get_option_parser():
    parser = COP(
        __doc__, prep=True,
        argdoc=[('SUITE', 'Suite name or path'),
                ('PATTERN', 'Python-style regular expression'),
                ('[PATTERN2...]', 'Additional search patterns')])

    parser.add_option(
        "-x", help="Do not search in the suite bin directory",
        action="store_false", default=True, dest="search_bin")

    return parser
Beispiel #9
0
def get_option_parser():
    """CLI."""
    parser = COP(__doc__,
                 jset=True,
                 prep=True,
                 argdoc=[('[SUITE]', 'Suite name or path'),
                         ('[START]', 'Initial cycle point '
                          '(default: suite initial point)'),
                         ('[STOP]', 'Final cycle point '
                          '(default: initial + 3 points)')])

    parser.add_option(
        '-u',
        '--ungrouped',
        help='Start with task families ungrouped (the default is grouped).',
        action='store_true',
        default=False,
        dest='ungrouped')

    parser.add_option('-n',
                      '--namespaces',
                      help='Plot the suite namespace inheritance hierarchy '
                      '(task run time properties).',
                      action='store_true',
                      default=False,
                      dest='namespaces')

    parser.add_option(
        '-r',
        '--reference',
        help='Output in a sorted plain text format for comparison purposes. '
        'If not given, assume --output-file=-.',
        action='store_true',
        default=False,
        dest='reference')

    parser.add_option(
        '--show-suicide',
        help='Show suicide triggers.  They are not shown by default, unless '
        'toggled on with the tool bar button.',
        action='store_true',
        default=False,
        dest='show_suicide')

    parser.add_option(
        '--icp',
        action='store',
        default=None,
        metavar='CYCLE_POINT',
        help=(
            'Set initial cycle point. Required if not defined in flow.cylc.'))

    return parser
Beispiel #10
0
def get_option_parser():
    parser = COP(
        __doc__, jset=True, prep=True, icp=True,
        argdoc=[('SUITE1', 'Suite name or path'),
                ('SUITE2', 'Suite name or path')])

    parser.add_option(
        "-n", "--nested",
        help="print suite.rc section headings in nested form.",
        action="store_true", default=False, dest="nested")

    return parser
Beispiel #11
0
def get_option_parser():
    parser = COP(
        __doc__, jset=True, prep=True, icp=True,
        argdoc=[('WORKFLOW1', 'Workflow name or path'),
                ('WORKFLOW2', 'Workflow name or path')])

    parser.add_option(
        "-n", "--nested",
        help="print flow.cylc section headings in nested form.",
        action="store_true", default=False, dest="nested")

    return parser
def get_option_parser():
    parser = COP(__doc__,
                 argdoc=[('[RESOURCE]', 'Resource to extract.'),
                         ('[DIR]', 'Target directory.')])

    parser.add_option(
        '--list',
        help="List available resources.",
        default=False,
        action='store_true',
    )

    return parser
Beispiel #13
0
def get_option_parser():
    parser = COP(__doc__, prep=True, jset=True)

    parser.add_option("-e",
                      "--error",
                      help="Exit with error status "
                      "if " + CYLC_VERSION +
                      " is not available on all remote platforms.",
                      action="store_true",
                      default=False,
                      dest="error")

    return parser
Beispiel #14
0
def get_option_parser():
    parser = COP(
        __doc__, comms=True, multitask=True,
        argdoc=[
            ("REG", "Suite name"),
            ('TASK_GLOB [...]', 'Task matching patterns')])

    parser.add_option(
        "--no-spawn",
        help="Do not spawn successors before removal.",
        action="store_true", default=False, dest="no_spawn")

    return parser
Beispiel #15
0
def get_option_parser():
    parser = COP(
        __doc__, comms=True, multitask_nocycles=True,
        argdoc=[
            ('REG', 'Suite name'),
            ('[TASK_GLOB ...]', 'Task matching patterns')])

    parser.add_option(
        "-r", "--reflow",
        help="Start a new flow from the triggered task.",
        action="store_true", default=False, dest="reflow")

    return parser
Beispiel #16
0
def get_option_parser():
    parser = COP(__doc__,
                 argdoc=[("REG", "Suite name"),
                         ("[ID ...]", "Checkpoint ID (default=latest)")])

    parser.add_option("-a",
                      "--all",
                      help="Display data of all available checkpoints.",
                      action="store_true",
                      default=False,
                      dest="all_mode")

    return parser
Beispiel #17
0
def get_option_parser():
    parser = COP(__doc__,
                 argdoc=[("[REG]", "Workflow name or path")],
                 jset=True,
                 icp=True)

    parser.add_option("-i",
                      "--item",
                      metavar="[SEC...]ITEM",
                      help="Item or section to print (multiple use allowed).",
                      action="append",
                      dest="item",
                      default=[])

    parser.add_option(
        '-d',
        '--defaults',
        help='Include the hard-coded Cylc default values in the output.',
        action='store_true',
        default=False)

    parser.add_option(
        "-n",
        "--null-value",
        help="The string to print for unset values (default nothing).",
        metavar="STRING",
        action="store",
        default='',
        dest="none_str")

    parser.add_option("-o",
                      "--one-line",
                      help="Print multiple single-value items at once.",
                      action="store_true",
                      default=False,
                      dest="oneline")

    parser.add_option(
        "--print-hierarchy",
        "--print-filenames",
        "--hierarchy",
        help=("Print the list of locations in which configuration files are "
              "looked for. An existing configuration file lower down the list "
              "overrides any settings it shares with those higher up."),
        action="store_true",
        default=False,
        dest="print_hierarchy")

    parser.add_cylc_rose_options()

    return parser
Beispiel #18
0
def get_option_parser():
    parser = COP(
        __doc__, comms=True,
        argdoc=[
            ('[REG]', 'Suite name'),
            ('[TASK-JOB]', 'Task job identifier CYCLE/TASK_NAME/SUBMIT_NUM'),
            ('[[SEVERITY:]MESSAGE ...]', 'Messages')])
    parser.add_option(
        '-s', '--severity', '-p', '--priority',
        metavar='SEVERITY',
        help='Set severity levels for messages that do not have one',
        action='store', dest='severity')

    return parser
Beispiel #19
0
def get_option_parser():
    parser = COP(
        __doc__, comms=True, multitask=True,
        argdoc=[
            ('REG', 'Workflow name'),
            ('[TASK_NAME or TASK_GLOB ...]', 'Task names or match patterns')])

    parser.add_option('--list-prereqs', action="store_true", default=False,
                      help="Print a task's pre-requisites as a list.")

    parser.add_option('--json', action="store_true", default=False,
                      help="Print output in JSON format.")

    return parser
Beispiel #20
0
def get_option_parser():
    parser = COP(__doc__, argdoc=[('WORKFLOW', 'Workflow name or ID')])
    parser.add_option(
        "-r",
        "--raw",
        help="Show raw timing output suitable for custom diagnostics.",
        action="store_true",
        default=False,
        dest="show_raw")
    parser.add_option("-s",
                      "--summary",
                      help="Show textual summary timing output for tasks.",
                      action="store_true",
                      default=False,
                      dest="show_summary")
    parser.add_option("-w",
                      "--web-summary",
                      help="Show HTML summary timing output for tasks.",
                      action="store_true",
                      default=False,
                      dest="html_summary")
    parser.add_option("-O",
                      "--output-file",
                      help="Output to a specific file",
                      action="store",
                      default=None,
                      dest="output_filename")

    return parser
Beispiel #21
0
def get_option_parser():
    parser = COP(__doc__, jset=True, prep=True, icp=True)

    parser.add_option(
        "--check-circular",
        help="Check for circular dependencies in graphs when the number of "
             "tasks is greater than 100 (smaller graphs are always checked). "
             "This can be slow when the number of "
             "tasks is high.",
        action="store_true", default=False, dest="check_circular")

    parser.add_option(
        "--output", "-o",
        help="Specify a file name to dump the processed flow.cylc.",
        metavar="FILENAME", action="store", dest="output")

    parser.add_option(
        "--profile", help="Output profiling (performance) information",
        action="store_true", default=False, dest="profile_mode")

    parser.add_option(
        "-u", "--run-mode", help="Validate for run mode.", action="store",
        default="live", dest="run_mode",
        choices=['live', 'dummy', 'dummy-local', 'simulation'])

    parser.set_defaults(is_validate=True)

    return parser
Beispiel #22
0
def get_option_parser():
    parser = COP(__doc__, jset=True, prep=True, icp=True)

    parser.add_option(
        "--strict",
        help="Fail any use of unsafe or experimental features. "
             "Currently this just means naked dummy tasks (tasks with no "
             "corresponding runtime section) as these may result from "
             "unintentional typographic errors in task names.",
        action="store_true", default=False, dest="strict")

    parser.add_option(
        "--output", "-o",
        help="Specify a file name to dump the processed flow.cylc.",
        metavar="FILENAME", action="store", dest="output")

    parser.add_option(
        "--profile", help="Output profiling (performance) information",
        action="store_true", default=False, dest="profile_mode")

    parser.add_option(
        "-u", "--run-mode", help="Validate for run mode.", action="store",
        default="live", dest="run_mode",
        choices=['live', 'dummy', 'dummy-local', 'simulation'])

    parser.set_defaults(is_validate=True)

    return parser
Beispiel #23
0
def get_option_parser():
    parser = COP(__doc__,
                 comms=True,
                 multitask=True,
                 argdoc=[("REG", "Suite name"),
                         ('[TASK_GLOB ...]', 'Task matching patterns')])

    parser.add_option("--after",
                      help="Hold whole suite AFTER this cycle point.",
                      metavar="CYCLE_POINT",
                      action="store",
                      dest="hold_point_string")

    return parser
Beispiel #24
0
def get_option_parser() -> COP:
    parser = COP(__doc__,
                 comms=True,
                 multitask=True,
                 argdoc=[('REG', "Workflow name"),
                         ('[TASK_GLOB ...]', "Task matching patterns")])

    parser.add_option("--after",
                      help="Hold all tasks after this cycle point.",
                      metavar="CYCLE_POINT",
                      action="store",
                      dest="hold_point_string")

    return parser
Beispiel #25
0
def get_option_parser():
    parser = COP(__doc__, argdoc=[])

    parser.add_option("-i",
                      "--item",
                      metavar="[SEC...]ITEM",
                      help="Item or section to print (multiple use allowed).",
                      action="append",
                      dest="item",
                      default=[])

    parser.add_option(
        "--sparse",
        help="Only print items explicitly set in the config files.",
        action="store_true",
        default=False,
        dest="sparse")

    parser.add_option("-p",
                      "--python",
                      help="Print native Python format.",
                      action="store_true",
                      default=False,
                      dest="pnative")

    parser.add_option("--print-run-dir",
                      help="Print the configured top level run directory.",
                      action="store_true",
                      default=False,
                      dest="run_dir")

    return parser
Beispiel #26
0
def get_option_parser():
    parser = COP(__doc__, comms=True, noforce=True)
    parser.add_option("-g",
                      "--global",
                      help="Global information only.",
                      action="store_const",
                      const="global",
                      dest="disp_form")
    parser.add_option("-t",
                      "--tasks",
                      help="Task states only.",
                      action="store_const",
                      const="tasks",
                      dest="disp_form")
    parser.add_option("-r",
                      "--raw",
                      "--raw-format",
                      help='Display raw format.',
                      action="store_const",
                      const="raw",
                      dest="disp_form")
    parser.add_option(
        "-s",
        "--sort",
        help="Task states only; sort by cycle point instead of name.",
        action="store_true",
        default=False,
        dest="sort_by_cycle")

    return parser
Beispiel #27
0
def get_option_parser():
    parser = COP(
        __doc__,
        multiworkflow=True,
        argdoc=[('WORKFLOW_ID [WORKFLOW_ID ...]', 'Workflow IDs')],
        segregated_log=True,
    )

    parser.add_option(
        '--rm',
        metavar='DIR[:DIR:...]',
        help=("Only clean the specified subdirectories (or files) in the "
              "run directory, rather than the whole run directory. "
              "Accepts quoted globs."),
        action='append',
        dest='rm_dirs',
        default=[])

    parser.add_option(
        '--local-only',
        '--local',
        help="Only clean on the local filesystem (not remote hosts).",
        action='store_true',
        dest='local_only')

    parser.add_option(
        '--remote-only',
        '--remote',
        help="Only clean on remote hosts (not the local filesystem).",
        action='store_true',
        dest='remote_only')

    parser.add_option(
        '--yes',
        '-y',
        help=("Skip interactive prompt if trying to clean multiple "
              "run directories at once."),
        action='store_true',
        dest='skip_interactive')

    parser.add_option(
        '--timeout',
        help=("The number of seconds to wait for cleaning to take place on "
              "remote hosts before cancelling."),
        action='store',
        default='120',
        dest='remote_timeout')

    return parser
Beispiel #28
0
def get_option_parser():
    """CLI opts for "cylc scan"."""
    parser = COP(
        __doc__,
        comms=True,
        argdoc=[],
    )

    parser.add_option(
        '--name',
        '-n',
        help=('Filter flows by registered name using a regex.'
              ' Can be used multiple times, workflows will be displayed if'
              ' their name matches ANY of the provided regexes.'),
        action='append')

    parser.add_option(
        '--states',
        help=('Choose which flows to display by providing a list of states'
              ' or "all" to show everything. See the full `cylc scan` help'
              ' for a list of supported states.'),
        default='running,held,stopping',
        action='store')

    parser.add_option('--format',
                      '-t',
                      help=('Set the output format.'
                            ' (rich: multi-line, human readable)'
                            ' (plain: single-line)'
                            ' (json: machine readable)'
                            ' (tree: display registration hierarchy as a tree)'
                            ' (name: just show flow names, machine readable)'),
                      choices=('rich', 'plain', 'json', 'tree', 'name'),
                      default='plain')

    parser.add_option(
        '--sort',
        help='Sort flows by name before writing them (takes longer).',
        action='store_true')

    parser.add_option(
        '--colour-blind',
        '--color-blind',
        help=(
            "Don't depend on colour to convey information. "
            ' Use this rather than --color=never so you still get bold text.'),
        action='store_true')

    return parser
Beispiel #29
0
def get_option_parser():
    parser = COP(__doc__,
                 comms=True,
                 multitask=True,
                 argdoc=[('REG', 'Suite name'),
                         ('[TASK_GLOB ...]', 'Task matching patterns')])

    parser.add_option("-s",
                      "--succeeded",
                      help="Allow polling of succeeded tasks.",
                      action="store_true",
                      default=False,
                      dest="poll_succ")

    return parser
Beispiel #30
0
def get_option_parser():
    parser = COP(__doc__,
                 comms=True,
                 prep=True,
                 argdoc=[("[REG]", "Workflow name")])

    parser.add_option("--flow-name",
                      help="Install into ~/cylc-run/<flow_name>/runN ",
                      action="store",
                      metavar="FLOW_NAME",
                      default=None,
                      dest="flow_name")

    parser.add_option("--directory",
                      "-C",
                      help="Install the workflow found in path specfied.",
                      action="store",
                      metavar="PATH/TO/FLOW",
                      default=None,
                      dest="source")

    parser.add_option(
        "--symlink-dirs",
        help=(
            "Enter a list, in the form 'log=path/to/store, share = $...'"
            ". Use this option to override local symlinks for directories run,"
            " log, work, share, share/cycle, as configured in global.cylc. "
            "Enter an empty list \"\" to skip making localhost symlink dirs."),
        action="store",
        dest="symlink_dirs")

    parser.add_option("--run-name",
                      help="Name the run.",
                      action="store",
                      metavar="RUN_NAME",
                      default=None,
                      dest="run_name")

    parser.add_option(
        "--no-run-name",
        help="Install the workflow directly into ~/cylc-run/<flow_name>",
        action="store_true",
        default=False,
        dest="no_run_name")

    parser.add_cylc_rose_options()

    return parser