get_command_argument_list
515916
public DeviceData[] get_command_specific_argument_list(final boolean fwd) throws DevFailed {
	final int al_size = get_size(fwd);
	final DeviceData[] al = new DeviceData[al_size];
	for (int i = 0; i < al_size; i++) {
	    al[i] = new DeviceData();
	}
	return al;
    }
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
1372970
def cmd2list(cmd):
   ''' 
   '''
   p = Popen(cmd, stdout=PIPE, stderr=PIPE, shell=True)
   stdout, stderr = p.communicate()
   if p.returncode != 0 and stderr != '':
      return "ERROR: %s\n"%(stderr)
   else:
      return stdout.split('\n')
129177
def _map_arguments(self, args):
        
        data = args.get('data')
        comp = args.get('comp')
        library = args.get('library')
        dry_run = args.get('dry_run', False)

        self._set_link('srcmaps-catalog', SrcmapsCatalog_SG,
                       comp=comp, data=data,
                       library=library,
                       nsrc=args.get('nsrc', 500),
                       dry_run=dry_run)

        self._set_link('gather-srcmaps', GatherSrcmaps_SG,
                       comp=comp, data=data,
                       library=library,
                       dry_run=dry_run)
        
        self._set_link('merge-srcmaps', MergeSrcmaps_SG,
                       comp=comp, data=data,
                       library=library,
                       dry_run=dry_run)
259754
def _make_cmd_list(cmd_list):
    
    cmd = ''
    for i in cmd_list:
        cmd = cmd + '"' + i + '",'
    cmd = cmd[:-1]
    return cmd
542532
def list_commands(self, ctx):
        
        commands_path = os.path.join(os.path.dirname(os.path.realpath(__file__)), 'commands')
        command_list = [name for __, name, ispkg in pkgutil.iter_modules([commands_path]) if ispkg]
        command_list.sort()
        return command_list
988672
def get_all_commands(self) -> List[str]:
        """"""
        return [name[len(COMMAND_FUNC_PREFIX):] for name in self.get_names()
                if name.startswith(COMMAND_FUNC_PREFIX) and callable(getattr(self, name))]
1156826
def get_args_tuple(args, kwargs, arg_names, kwargs_defaults):
    """"""
    args_list = list(args)
    args_len = len(args)
    all_args_len = len(arg_names)
    try:
        while args_len < all_args_len:
            arg_name = arg_names[args_len]
            if arg_name in kwargs_defaults:
                args_list.append(kwargs.get(arg_name, kwargs_defaults[arg_name]))
            else:
                args_list.append(kwargs[arg_name])
            args_len += 1
    except KeyError as e:
        raise TypeError("Missing argument %r" % (e.args[0],))
    return tuple(args_list)
1193628
public function getArguments()
    {
        // Checks if script received command arguments.
        $cmdArguments = $this->event->getArguments();
        if (!$cmdArguments) {
            throw new \ErrorException('Hydrate command expects arguments.');
        }

        // Treats arguments.
        $returnArguments = array();
        foreach ($cmdArguments as $cmdArgument) {
            $cmdArgument = explode('=', $cmdArgument);
            $argument = $cmdArgument[0];

            // Checks if the argument exists.
            if (!$this->cmdArgumentExist($argument)) {
                throw new \ErrorException("Command argument '$argument' do not exist.");
            }

            // Treats REPLACE_ARG argument.
            if ($argument == self::REPLACE_ARG) {
                $replaceValues = !empty($cmdArgument[1]) ? $cmdArgument[1] : null;
                if (!$replaceValues) {
                    $msg = 'Command argument "--replace" must contain values, like: --replace="{SEARCH}:{REPLACE},.."';
                    throw new \ErrorException($msg);
                }

                $returnArguments[self::REPLACE_ARG] = $this->getReplaceValuesFromArgument($replaceValues);
            }
        }

        return $returnArguments;
    }
1365147
def _get_arg_tokens(cli):
    
    arg = cli.input_processor.arg

    return [
        (Token.Prompt.Arg, '(arg: '),
        (Token.Prompt.Arg.Text, str(arg)),
        (Token.Prompt.Arg, ') '),
    ]
277417
def get_arguments():
    
    # https://docs.python.org/3/library/argparse.html
    parser = argparse.ArgumentParser(
        description='Handles bumping of the artifact version')
    parser.add_argument('--log-config',
                        '-l',
                        action='store',
                        dest='logger_config',
                        help='The location of the logging config json file',
                        default='')
    parser.add_argument('--log-level',
                        '-L',
                        help='Provide the log level. Defaults to INFO.',
                        dest='log_level',
                        action='store',
                        default='INFO',
                        choices=['DEBUG',
                                 'INFO',
                                 'WARNING',
                                 'ERROR',
                                 'CRITICAL'])
    parser.add_argument('--major',
                        help='Bump the major version',
                        dest='bump_major',
                        action='store_true',
                        default=False)
    parser.add_argument('--minor',
                        help='Bump the minor version',
                        dest='bump_minor',
                        action='store_true',
                        default=False)
    parser.add_argument('--patch',
                        help='Bump the patch version',
                        dest='bump_patch',
                        action='store_true',
                        default=False)
    parser.add_argument('--version',
                        help='Set the version',
                        dest='version',
                        action='store',
                        default=False)
    args = parser.parse_args()
    return args
573489
function getArguments() {
  var port = 3000;
  var path = '.';
  var args = process.argv.slice(2);

  while (args.length) {
    var arg = args.shift();
    switch (arg) {
      case '-p':
        port = args.shift();
        break;
      default:
        path = arg || path;
    }
  }

  return {
    port: port,
    path: path
  };
}
797498
def _arguments(ctx, command_name=None):
    
    ctx = ctx.parent
    main = ctx.command
    if command_name:
        command = main.get_command(ctx, command_name)
        if not command:
            return
    else:
        command = main

    types = ["option", "argument"]
    all_params = sorted(
        command.get_params(ctx), key=lambda p: types.index(p.param_type_name)
    )

    def get_name(param):
        return max(param.opts, key=len)

    for param in all_params:
        if param.param_type_name == "option":
            option = get_name(param)
            same_dest = [
                get_name(p) for p in all_params if p.name == param.name
            ]
            if same_dest:
                option = "({})".format(" ".join(same_dest)) + option
            if param.help:
                option += "[{}]".format(param.help or "")
            if not param.is_flag:
                option += "=:( )"
            click.echo(option)
        elif param.param_type_name == "argument":
            option = get_name(param)
            click.echo(":{}".format(option))
780145
def getArguments(parser):
    ""
    args = parser.parse_args()
    # parse volume and adapt to zero-indexing
    try:
        def _to_int_or_none(string):
            if 0 == len(string): return None
            return int(string)
        def _to_int_or_none_double (string):
            if 0 == len(string): return [None, None]
            return list(map(_to_int_or_none, string.split(':')))        
        args.volume = list(map(_to_int_or_none_double, args.volume.split(',')))
        args.volume = [(x[0], x[1]) for x in args.volume]
    except (ValueError, IndexError) as e:
        raise ArgumentError('Maleformed volume parameter "{}", see description with -h flag.'.format(args.volume), e)

    return args
733198
def get_commands_from(self, args):
        
        commands = []
        for i in itertools.count(0):
            try:
                commands.append(getattr(args, self.arg_label_fmt % i))
            except AttributeError:
                break
        return commands
353938
def getArguments():
    
    parser = ArgumentParser(description = 'CA utility')
    parser.add_argument('--base', dest = 'basePath', default = '.', help = 'The base working directory')
    subParsers = parser.add_subparsers(dest = 'action')
    # The init parser
    initParser = subParsers.add_parser('init', help = 'Initialize the database')
    # Vertify certificatae
    verifyParser = subParsers.add_parser('verify', help = 'Verify certificate')
    verifyParser.add_argument('--name', dest = 'name', required = True, help = 'The certificate name')
    # Create root certificate parser
    createRootCertParser = subParsers.add_parser('createRootCert', help = 'Create root certificate')
    createRootCertParser.add_argument('--nopass', dest = 'noPass', default = False, action = 'store_true', help = 'Generate root key without a password (Not recommended), false by default.')
    createRootCertParser.add_argument('--keylen', dest = 'keyLength', default = '4096', choices = [ '2048', '4096' ], help = 'The root key length, 4096 by default')
    # Create server certificate parser
    createServerCertParser = subParsers.add_parser('createServerCert', help = 'Create server cert')
    createServerCertParser.add_argument('--name', dest = 'name', required = True, help = 'The certificate name')
    createServerCertParser.add_argument('--usepass', dest = 'usePass', default = False, action = 'store_true', help = 'Generate key with a password, false by default.')
    createServerCertParser.add_argument('--keylen', dest = 'keyLength', default = '2048', choices = [ '2048', '4096' ], help = 'The key length, 2048 by default')
    createServerCertParser.add_argument('--days', dest = 'days', type = int, default = 3650, help = 'The certificate days parameter')
    # Create client certificate parser
    createClientCertParser = subParsers.add_parser('createClientCert', help = 'Create server cert')
    createClientCertParser.add_argument('--name', dest = 'name', required = True, help = 'The certificate name')
    createClientCertParser.add_argument('--usepass', dest = 'usePass', default = False, action = 'store_true', help = 'Generate key with a password, false by default.')
    createClientCertParser.add_argument('--keylen', dest = 'keyLength', default = '2048', choices = [ '2048', '4096' ], help = 'The key length, 2048 by default')
    createClientCertParser.add_argument('--days', dest = 'days', type = int, default = 3650, help = 'The certificate days parameter')
    # Done
    return parser.parse_args()
525622
def get_commands(self, view=None):
    
    return self._get("commands", ApiCommand, True,
        params = view and dict(view=view) or None)