> Create flexible arguments - check types.

@param  {Object} `argz`
@return {Object}
@api private
332929
function checkArguments (argz) {
  if (!argz.args.length) {
    return error('first argument cant be function')
  }

  if (isEmptyFunction(argz.cb.toString())) {
    return error('should have `callback` (non empty callback)')
  }

  if (typeOf(argz.args[0]) !== 'string') {
    return type('expect `cmd` be string', argz.cb)
  }

  if (typeOf(argz.args[1]) === 'object') {
    argz.args[2] = argz.args[1]
    argz.args[1] = []
  }

  if (typeOf(argz.args[2]) !== 'object') {
    argz.args[2] = {}
  }

  return {
    cmd: argz.args[0],
    args: argz.args[1],
    opts: argz.args[2],
    callback: argz.cb
  }
}
425704
function wrapArgs (args, visited = new Set()) {
  const valueToMeta = (value) => {
    // Check for circular reference.
    if (visited.has(value)) {
      return {
        type: 'value',
        value: null
      }
    }

    if (Array.isArray(value)) {
      visited.add(value)
      const meta = {
        type: 'array',
        value: wrapArgs(value, visited)
      }
      visited.delete(value)
      return meta
    } else if (bufferUtils.isBuffer(value)) {
      return {
        type: 'buffer',
        value: bufferUtils.bufferToMeta(value)
      }
    } else if (value instanceof Date) {
      return {
        type: 'date',
        value: value.getTime()
      }
    } else if ((value != null) && typeof value === 'object') {
      if (isPromise(value)) {
        return {
          type: 'promise',
          then: valueToMeta(function (onFulfilled, onRejected) {
            value.then(onFulfilled, onRejected)
          })
        }
      } else if (v8Util.getHiddenValue(value, 'atomId')) {
        return {
          type: 'remote-object',
          id: v8Util.getHiddenValue(value, 'atomId')
        }
      }

      const meta = {
        type: 'object',
        name: value.constructor ? value.constructor.name : '',
        members: []
      }
      visited.add(value)
      for (const prop in value) {
        meta.members.push({
          name: prop,
          value: valueToMeta(value[prop])
        })
      }
      visited.delete(value)
      return meta
    } else if (typeof value === 'function' && v8Util.getHiddenValue(value, 'returnValue')) {
      return {
        type: 'function-with-return-value',
        value: valueToMeta(value())
      }
    } else if (typeof value === 'function') {
      return {
        type: 'function',
        id: callbacksRegistry.add(value),
        location: v8Util.getHiddenValue(value, 'location'),
        length: value.length
      }
    } else {
      return {
        type: 'value',
        value: value
      }
    }
  }
  return args.map(valueToMeta)
}
280822
function handleArguments(args) {
  return new Promise(function(resolve, reject) {
    var requires = [];
    var promises = [];

    // check for Promises in args
    if (args && args instanceof Array) {
      args.some(function (arg, i) {
        if ((arg.value === null || typeof(arg.value) == 'undefined') && arg.optional) {
          return true;
        }

        if (arg.value && Array.isArray(arg.value) && arg.optional && arg.value.length == 0) {
          return true;
        }

        if (arg.type == 'string') {
          var s = '"' + arg.value.replace(/"/g, '\\\"') + '"';
          promises.push(Promise.resolve(s));
        } else if (arg.type == 'lambda') {
          promises.push(serializeLambda(arg.value));
        } else if (arg.type == 'lambdaArgs') {
          promises.push(new Promise(function(resolve, reject) {
            handleArrayArgument(arg.value).then(function (result) {
              resolve(result);
            }).catch(reject);
          }));
        } else if (arg.type == 'map') {
          promises.push(Promise.resolve(JSON.stringify(arg.value)));
        } else if (arg.type == 'promise') {
          promises.push(new Promise(function(resolve, reject) {
            arg.value.then(function(val) {
              if (typeof(val) == 'string') {
                if (isNaN(val)) {
                  // a string
                  var s = '"' + val.replace(/"/g, '\\\"') + '"';
                  resolve(s);
                } else {
                  resolve(parseFloat(val));
                }
              } else {
                resolve(val);
              }
            });
          }));
        } else if (arg.value.refIdP) {
          promises.push(arg.value.refIdP);
        } else if (arg.type == 'List') {
          promises.push(Promise.resolve(arg.value.toString()));
        } else if (arg.type == 'array') {
          // simple array argument
          promises.push(handleArrayArgument(arg.value));
        } else if (arg.type == '_eclairSerialize') {
          if (arg.value._eclairSerialize == 'staticProperty') {
            var val = arg.value.ref.name + '.' + arg.value.value;
            promises.push(Promise.resolve(val));
            requires.push({name: arg.value.ref.name, moduleLocation: arg.value.ref.moduleLocation});
          }
        } else if (Array.isArray(arg.value)) {
          // TODO: should we try to wrap the array if it isn't?
          promises.push(new Promise(function (resolve, reject) {
            handleArguments(arg.value).then(function (result) {
              if (result.requires.length > 0) {
                result.requires.forEach(function (r) {
                  requires.push(r)
                });
              }

              resolve('[' + result.args + ']');
            }).catch(reject);
          }));
        } else if (arg.type == '_eclairForceFloat') {
          var val = arg.value.value;
          if (val.toString().indexOf('.') === -1) {
            val = val.toFixed(1);
          }
          promises.push(Promise.resolve(val));
        } else if (arg.type == '_eclairLocal') {
          promises.push(Promise.resolve(arg.value._generateRemote().refIdP));
        } else if (arg.type == 'sparkclassref') {
          // we have a spark class reference, so return its name
          promises.push(Promise.resolve(arg.value.name));
          // add the class to the requires list
          requires.push({name: arg.value.name, moduleLocation: arg.value.moduleLocation});
        } else {
          promises.push(Promise.resolve(arg.value));
        }

        return false;
      });
    }

    Promise.all(promises).then(function(finalArgs) {
      resolve({args: finalArgs, requires: requires});
      //resolve(finalArgs);
    }).catch(function(e) {
      console.log(e);
      reject(e)
    });
  });
}
81721
function extend(...args){
	if ( !args.length || isArray(args[0]) || !args[0] ) return null;

	let keys = args[args.length-1];
	if ( !keys ) return;

	let oOrig = args[0];
	oOrig.class = classToPlantObject(oOrig.class);

	if ( isArray(keys) ) {
		for ( let i=0, oCopy; i<args.length-1; i++ ) {
			oCopy = args[i];
			if ( oOrig !== oCopy && isPlainObject(oCopy) ) {
				keys.forEach(k => {
					if ( oCopy[k] !== undefined ) {
						k == 'class' ? Object.assign(oOrig.class, classToPlantObject(oCopy[k])) : (oOrig[k] = _copyObjectValue(oCopy[k]));
					}
				});
			}
		}
	}else{
		for ( let i=1, oCopy; i<args.length; i++ ) {
			oCopy = args[i];
			if ( oOrig !== oCopy && isPlainObject(oCopy) ) {
				for ( let k in oCopy ) {
					k == 'class' ? Object.assign(oOrig.class, classToPlantObject(oCopy[k])) : (oOrig[k] = _copyObjectValue(oCopy[k]));
				}
			}
		}
	}
	return oOrig;
}
66061
def arguments(args = nil)
      return @_arguments if args.nil?
      @_arguments = []
      [*args].map(&:split).flatten.each do |arg|
        @_arguments << Clin::Argument.new(arg)
      end
    end
1126409
def parsed_options_from_arguments(argv)
      options_to_merge = {}

      OptionParser.new do |opts|
        opts.banner = 'Usage: phare [options]'

        opts.on('--version', 'Display Phare’s version') do
          options_to_merge[:version] = true
        end

        opts.on('--directory x', 'The directory in which to run the checks (default is the current directory') do |directory|
          options_to_merge[:directory] = directory
        end

        opts.on('--skip x,y,z', 'Skip checks') do |checks|
          options_to_merge[:skip] = checks.split(',')
        end

        opts.on('--only x,y,z', 'Only run the specified checks') do |checks|
          options_to_merge[:only] = checks.split(',')
        end

        opts.on('--diff', 'Only run checks on modified files') do
          options_to_merge[:diff] = true
        end
      end.parse! argv

      options_to_merge
    end
458311
function ( arg, obj ) {
		if ( $[arg] !== undefined || !obj instanceof Object ) {
			throw new Error( label.error.invalidArguments );
		}
		
		$[arg] = obj;

		return $[arg];
	}
523863
function filterArguments(args, params, inject) {

	var newArgs = ['node', '_mocha'].concat(inject || []),
		param, i, len,
		type;

	for (i = 2, len = args.length; i < len; i++) {

		if ((i < args.length - 1) && (args[i].length > 2) && (args[i].substr(0, 2) === '--')) {

			// Get parameter without '--'
			param = args[i].substr(2);

			// Is parameter used?
			if (params.hasOwnProperty(param)) {

				// Remember what the type was
				type = typeof params[param];

				// Overwrite value with next value in arguments
				if (type === 'boolean') {
					params[param] = true;

				} else {
					params[param] = args[i + 1];
					i++;

					// Convert back to boolean if needed
					if (type === 'number') {
						params[param] = parseFloat(params[param]);
					}
				}

			} else {
				newArgs.push(args[i]);
			}
		} else {
			newArgs.push(args[i]);
		}
	}

	// Set test-path with last argument if none given
	if (!params['test-path']) {
		params['test-path'] = args.pop();
	}

	newArgs.push(path.join(__dirname, '..', 'resource', 'run.js'));

	return newArgs;
}
62227
function _from_args (opts, cfg_so_far, cb) {
  var args = parseArgs (opts.input || (process.argv.slice(2))); 
  var ka = [];
  var va = [];

  _.forEach (args, function (v, k) {
    if (k == '_') return;

    // change __ into . in k
    k = k.replace (/__/g, '.');

    if (opts.regexp && !(k.match (opts.regexp))) return;
    if (opts.prefix && !(_.startsWith (k, opts.prefix))) return;

    if (opts.prefix) k = k.substr (opts.prefix.length);

    ka.push (k);
    va.push (v);
  });

  var obj = _.zipObjectDeep(ka, va);
  _expand (obj, cfg_so_far, cb);
}
769336
def _process_arguments(self, arguments):
        
        if not arguments:
            return None
        a = arguments.split(" :", 1)
        arglist = a[0].split()
        if len(a) == 2:
            arglist.append(a[1])
        return arglist
1350814
def p_args(p):
    
    if len(p) == 2:
        p[0] = node.expr_list([p[1]])
    else:
        p[0] = p[1]
        p[0].append(p[2])
184331
function splitArgObjects (args) {
  const newArgs = []
  let index = 0

  while (index < args.length) {
    const arg = args[index]

    if (arg.indexOf('{') !== -1) {
      const temp = []

      while (args[index].indexOf('}') === -1) {
        temp.push(args[index])
        index++
      }
      temp.push(args[index])

      newArgs.push(temp.join(' ').replace(/([\w\d-]+):\s*([\w\d-]*)/g, '"$1": "$2"'))
    } else {
      newArgs.push(arg)
    }

    index++
  }

  return newArgs
}
1104493
function splitArgsIntoOptionsAndCallback (args) {
  let params;
  let options;
  let cb;
  if (args.length > 1) {
    const possibleCb = args[args.length - 1];
    if ('function' === typeof possibleCb) {
      cb = possibleCb;
      options = args.length === 3 ? args[1] : undefined;
    } else {
      options = args[1];
    }
    params = args[0];
  } else if ('object' === typeof args[0]) {
    params = args[0];
  } else if ('function' === typeof args[0]) {
    cb = args[0];
  }
  return { params, options, cb };
}
1228469
function checkArgs() {
  if (arguments.length === 0) {
    throw new Error('no argument for executing resource service');
  }

  var args = arguments[0];
  if (args.name === void 0) {
    throw new Error('no name for executing resource service');
  }

  return args;
}
556918
function(...a_args) {

		// ref args length and 0th arg
		let n_args = a_args.length;
		let z_arg0 = a_args[0];

		// no arguments OR single argument is a boolean (fetch)
		if(n_args === 0 || (n_args === 1 && 'boolean' === typeof z_arg0)) {

			// no soft/hard options
			if('function' === typeof h_handler.fetch) {
				return h_handler.fetch();
			}
			// fetch soft
			else if(!n_args || false === z_arg0) {
				return h_handler.fetch.soft();
			}
			// fetch hard
			else {
				return h_handler.fetch.hard();
			}
		}
		// add
		else {
			h_handler.add(...a_args);
		}

		// update self reference to this
		self = this;

		// chain
		return this;
	}
406998
def argument(value, options = {})
      return unless @shell.applicable?(options)
      value = value.to_s
      if @shell.requires_escaping?(value)
        value = @shell.escape_value(value)
      end
      @command << ' ' << value
      @last_arg = :argument
    end
820993
function createArguments() {
  var cli = commandLineArgs([{
    name: 'file',
    alias: 'f',
    type: String,
    defaultValue: "",
    description: "Full path to the credentials file.",
    required: true
  }, {
    name: 'section',
    alias: 's',
    type: String,
    defaultValue: "default",
    description: "Title of the section that will be added to the .edgerc file."
  }, {
    name: 'path',
    alias: 'p',
    type: String,
    defaultValue: os.homedir() + "/.edgerc",
    description: "Full path to the .edgerc file."
  }, {
    name: 'help',
    alias: 'h',
    description: "Display help and usage information."
  }]);

  return cli;
}