display a list of tasks for CLI completion
16740
def list_bare_tasks
      load_tasks

      Thor::Base.subclasses.each do |klass|
        unless klass == Thor
          klass.tasks.each do |t|
            puts "#{klass.namespace}:#{t[0]}"
          end
        end
      end
    end
368822
def load_tasks(self, command='all'):
        

        results = dict(
            (db, self._get_task_objects('status:%s' % db, 'export'))
            for db in Command.files(command)
        )

        # 'waiting' tasks are returned separately from 'pending' tasks
        # Here we merge the waiting list back into the pending list.
        if 'pending' in results:
            results['pending'].extend(
                self._get_task_objects('status:waiting', 'export'))

        return results
1365423
def show_tricky_tasks(self, verbose=0):
        
        nids, tasks = [], []
        for task in self.iflat_tasks():
            if task.num_launches > 1 or any(n > 0 for n in (task.num_restarts, task.num_corrections)):
                nids.append(task.node_id)
                tasks.append(task)

        if not nids:
            cprint("Everything's fine, no tricky tasks found", color="green")
        else:
            self.show_status(nids=nids)
            if not verbose:
                print("Use --verbose to print task history.")
                return

            for nid, task in zip(nids, tasks):
                cprint(repr(task), **task.status.color_opts)
                self.show_history(nids=[nid], full_history=False, metadata=False)
                #if task.num_restarts:
                #    self.show_restarts(nids=[nid])
                if task.num_corrections:
                    self.show_corrections(nids=[nid])
305496
def display_tasks_and_comments
      displayable_tasks = tasks.select { |t|
        (options.show_all_tasks || t.comment) &&
          t.name =~ options.show_task_pattern
      }
      case options.show_tasks
      when :tasks
        width = displayable_tasks.map { |t| t.name_with_args.length }.max || 10
        if truncate_output?
          max_column = terminal_width - name.size - width - 7
        else
          max_column = nil
        end

        displayable_tasks.each do |t|
          printf("#{name} %-#{width}s  # %s\n",
            t.name_with_args,
            max_column ? truncate(t.comment, max_column) : t.comment)
        end
      when :describe
        displayable_tasks.each do |t|
          puts "#{name} #{t.name_with_args}"
          comment = t.full_comment || ""
          comment.split("\n").each do |line|
            puts "    #{line}"
          end
          puts
        end
      when :lines
        displayable_tasks.each do |t|
          t.locations.each do |loc|
            printf "#{name} %-30s %s\n", t.name_with_args, loc
          end
        end
      else
        fail "Unknown show task mode: '#{options.show_tasks}'"
      end
    end
1127455
function list(context, err, items, paths) {
    if (err) return fail(context, err);
    
    var long = context.options["l"];
    
    if (typeof long === "undefined") long = (context.command.slice(-3) === "dir");
    
    items.forEach(function (item) {
        if (item.filename == "." || item.filename == "..") return;
        
        if (paths) {
            shell.write(item.path);
        } else if (long) {
            shell.write(item.longname);
        } else {
            shell.write(item.filename);
        }
    });
    
    context.end();
}
1181616
def get_tasks():
    """"""
    from paver.tasks import environment
    for tsk in environment.get_tasks():
        print(tsk.shortname)
369814
def show(ctx, search):
    
    matches = {'aliases': [], 'mappings': [], 'projects': []}
    projects_db = ctx.obj['projects_db']

    matches = get_alias_matches(search, matches)
    matches = get_mapping_matches(search, matches, projects_db)
    matches = get_project_matches(search, matches, projects_db)

    ctx.obj['view'].show_command_results(search, matches, projects_db)
893350
def cmd_list(unused_conf: Config):
    """"""
    for name, builder in sorted(Plugin.builders.items()):
        if builder.func:
            print('+- {0:16s} implemented in {1.__module__}.{1.__name__}()'
                  .format(name, builder.func))
        else:
            print('+- {0:16s} loaded with no builder function'.format(name))
        for hook_name, hook_func in sorted(Plugin.get_hooks_for_builder(name)):
            print('  +- {0} hook implemented in '
                  '{1.__module__}.{1.__name__}()'
                  .format(hook_name, hook_func))
137257
def completedefault(self, text, line, begidx, endidx):
        """"""
        if self.argparser_completer and any((line.startswith(x) for x in self.argparse_names())):
            self.argparser_completer.rl_complete(line, 0)
            return [x[begidx:] for x in self.argparser_completer._rl_matches]
        else:
            return []
847692
def command_list(self, sources, _opt=False):
        ''''''
        def abspath(x):
            x = Path(x).abspath()
            if not x.exists():
                raise ValueError('file not found! ' + x)
            return x

        self.f_cpu = int(self.f_cpu)

        self.mcu = str(self.mcu)
#        if not self.mcu  in self.targets:
#            raise ValueError('invalid mcu:' + self.mcu)

        if not _opt:
            sources = [abspath(x) for x in sources]
        includes = [abspath(x) for x in self.includes]

        if not self.output:
            self.output = tempfile.NamedTemporaryFile(
                prefix='pyavrutils_', suffix='.elf', delete=0).name

        defines = self.defines + ['F_CPU=' + str(self.f_cpu)]

        cmd = [self.cc]
        if not self.use_only_extra_options:
            if not _opt:
                cmd += sources
            cmd += ['-D' + x for x in defines]
            cmd += ['-I' + x for x in includes]
            if not _opt:
                cmd += ['-o', self.output]
            cmd += ['-mmcu=' + self.mcu]
            cmd += ['--std=' + self.std]
            if self.relax:
                cmd += ['-Wl,--relax']
            if self.gc_sections:
                cmd += ['-Wl,--gc-sections']
            if self.ffunction_sections:
                cmd += ['-ffunction-sections']
            if self.fdata_sections:
                cmd += ['-fdata-sections']
            if self.fno_inline_small_functions:
                cmd += ['-fno-inline-small-functions']
            if self.optimization != 0:
                cmd += ['-O' + str(self.optimization)]

        cmd += self.options_extra
        return cmd
828729
def print_smart_tasks():
    """"""
    print("Printing information about smart tasks")
    tasks = api(gateway.get_smart_tasks())
    if len(tasks) == 0:
        exit(bold("No smart tasks defined"))

    container = []
    for task in tasks:
        container.append(api(task).task_control.raw)
    print(jsonify(container))
36136
def tasks(search_word, options)
      todo_s = todos search_word
      doing_s = doings search_word
      done_s = dones search_word
      todo_s, doing_s, done_s = coloring(options, todo_s, doing_s, done_s)
      categorise(options, todo_s, doing_s, done_s)
      todo_s + doing_s + done_s
    end
686130
def cli(ctx, env):
    """"""
    env.out("Welcome to the SoftLayer shell.")
    env.out("")

    formatter = formatting.HelpFormatter()
    commands = []
    shell_commands = []
    for name in cli_core.cli.list_commands(ctx):
        command = cli_core.cli.get_command(ctx, name)
        if command.short_help is None:
            command.short_help = command.help
        details = (name, command.short_help)
        if name in dict(routes.ALL_ROUTES):
            shell_commands.append(details)
        else:
            commands.append(details)

    with formatter.section('Shell Commands'):
        formatter.write_dl(shell_commands)

    with formatter.section('Commands'):
        formatter.write_dl(commands)

    for line in formatter.buffer:
        env.out(line, newline=False)
530006
def list_tasks(self):
        
        from highton.models.task import Task

        return fields.ListField(
            name=self.ENDPOINT,
            init_class=Task
        ).decode(
            self.element_from_string(
                self._get_request(
                    endpoint=self.ENDPOINT + '/' + str(self.id) + '/' + Task.ENDPOINT,
                ).text
            )
        )
239466
private function showlist()
     {
        $this->getMessage('help');

        foreach ($this->options as $opt) {
            echo "\n";
            echo "\t \t \t", $this->log(" ".$opt['name']." => ".$opt['description']." ", 'success');
            echo "\n";
        }
     }
918111
def task2ics():
    """"""
    from argparse import ArgumentParser, FileType
    from sys import stdout

    parser = ArgumentParser(description='Converter from Taskwarrior to iCalendar syntax.')
    parser.add_argument('indir', nargs='?', help='Input Taskwarrior directory (default to ~/.task)', default=expanduser('~/.task'))
    parser.add_argument('outfile', nargs='?', type=FileType('w'), default=stdout,
                        help='Output iCalendar file (default: stdout)')
    args = parser.parse_args()

    task = IcsTask(args.indir)
    args.outfile.write(task.to_vobject().serialize())
97966
def find_tasks(source_code):
    """"""
    results = []
    for line, text in enumerate(source_code.splitlines()):
        for todo in re.findall(TASKS_PATTERN, text):
            todo_text = (todo[-1].strip(' :').capitalize() if todo[-1]
                         else todo[-2])
            results.append((todo_text, line + 1))
    return results