Sets all properties from the given array of arguments

@param args the args
187018
public static void setAllCommandLine(String[] args) {
      if (args != null) {
         CommandLineParser parser = new CommandLineParser();
         parser.parse(args);
         setAllCommandLine(parser);
      }
   }
778844
def set_from_args(options)
      assign(options)
    rescue ConfigError => e
      alert_logger.warn format(
        'Failed to configure from arguments: %s',
        e.message
      )
    end
591146
private void handleArgPropertyFile(final String arg, final Deque<String> args) {
        final Map.Entry<String, String> entry = parse(arg.substring(2), args);
        if (entry.getValue() == null) {
            throw new BuildException("You must specify a property filename when using the --propertyfile argument");
        }
        propertyFiles.addElement(entry.getValue());
    }
1124268
@Configurable
  public void addArg(String arg)
  {
    if (_args == null)
      _args = new ArrayList<String>();
    
    _args.add(arg);
  }
1302557
public void setParameters(Properties params)
  {

    clearParameters();

    Enumeration names = params.propertyNames();

    while (names.hasMoreElements())
    {
      String name = params.getProperty((String) names.nextElement());
      StringTokenizer tokenizer = new StringTokenizer(name, "{}", false);

      try
      {

        // The first string might be the namespace, or it might be 
        // the local name, if the namespace is null.
        String s1 = tokenizer.nextToken();
        String s2 = tokenizer.hasMoreTokens() ? tokenizer.nextToken() : null;

        if (null == s2)
          setParameter(s1, null, params.getProperty(name));
        else
          setParameter(s2, s1, params.getProperty(name));
      }
      catch (java.util.NoSuchElementException nsee)
      {

        // Should throw some sort of an error.
      }
    }
  }
1098221
@Override
    public void setProperties(Map<Object, Object> properties) {

        Iterator<Object> keys = properties.keySet().iterator();
        while (keys.hasNext()) {
            Object key = keys.next();
            lazyProperties().put(key, properties.get(key));
        }
    }
592430
public void init(String[] args)
    {
        BaseApplet applet = null;
        if (!gbStandAlone)
            applet = this;
        if (m_application == null)
        {
            Map<String,Object> properties = null;
            if (args != null)
            {
                properties = new Hashtable<String,Object>();
                Util.parseArgs(properties, args);
            }
            m_application = new ThinApplication(null, properties, applet);      // Start the session for this user
        }
        m_application.addTask(this, null);                    // Add this session to the list
        
        m_recordOwnerCollection = new RecordOwnerCollection(this);

        try   {	// Add browser connection if running as an applet
            Class.forName("netscape.javascript.JSObject"); // Test if this exists
            Map<String,Object> mapInitialCommand = new HashMap<String,Object>();
            String strInitialCommand = this.getInitialCommand(true);
            if ((strInitialCommand != null) && (strInitialCommand.length() > 0))
            	Util.parseArgs(mapInitialCommand, strInitialCommand);
            BrowserManager bm = new BrowserManager(this, mapInitialCommand);	// This will throw an exception if there is a no browser
            this.setBrowserManager(bm);
        } catch (Exception ex)  { // Ignore if no browser
        }
        if (m_application.getProperty("hash") != null)
        {	// Special case - html hash params get added (and override) initial params
            Map<String,Object> properties = this.getProperties();
            if (properties == null)
            	properties = new Hashtable<String,Object>();
        	Util.parseArgs(properties, m_application.getProperty("hash"));
        	this.setProperties(properties);
        }
        m_parent = this.addBackground(this);
        this.addSubPanels(m_parent, Constants.DONT_PUSH_TO_BROWSER);    // Add any sub-panels now

        this.setupLookAndFeel(null);
        
        if (this.getBrowserManager() != null)
        	if ((this.getClass().getName().indexOf(".thin.") != -1) || (this.getClass().getName().indexOf(".Thin") != -1))
        		this.repaint();		// HACK - On thin if this is in an applet window, the paint sequence displays the overlays backward
    }
694950
public static void main(String[] args) {
        try {
            if (args.length == 1 && args[0].endsWith(".properties")) {
                Properties properties = loadProperties(args[0]);
                new StanBench(properties).run();
            } else {
                new StanBench(args).run();
            }
        } catch (Exception e) {
            e.printStackTrace();
            System.exit(-1);
        }
        System.exit(0);
    }
996796
@Configurable
  public void setArgs(String arg)
  {
    int i = 0;
    int len = arg.length();

    CharBuffer cb = new CharBuffer();
    
    while (i < len) {
      char ch;
      for (; i < len && Character.isWhitespace(ch = arg.charAt(i)); i++) {
      }

      if (len <= i)
        return;

      cb.clear();

      for (; i < len && ! Character.isWhitespace(ch = arg.charAt(i)); i++)
        cb.append(ch);

      addArg(cb.toString());
    }
  }
480223
public void setParameters(java.util.Map<String, java.util.List<String>> parameters) {
        this.parameters = parameters;
    }
1133709
public void setParameters(Map<String, String> parameters) {
        this.parameters.clear();
        this.parameters.putAll(parameters);
    }
638124
def args(self, args):
        '''
        '''
        self._args = args
        self._logger.log('debug', 'Args set to {}'.format(args))
708090
public function setArguments(array $arguments)
    {
        $this->checkStringArgument($arguments, 2);
        $this->checkStringArguments($arguments);
        $this->arguments = $arguments;
    }
805069
function(type, args, obj) {
        var selected = args[0],
            cfgSelected = DEF_CFG.SELECTED.key;
        
        if (selected) {
            if (Lang.isString(selected)) {
                this.cfg.setProperty(cfgSelected, this._parseDates(selected), true);
            } 
        }
        if (! this._selectedDates) {
            this._selectedDates = this.cfg.getProperty(cfgSelected);
        }
    }
845360
public static Properties getCommandLineProperties(String... args) {
		Properties retval = new Properties();
		for (int i = 0; i < args.length; i++) {
			if (args[i].startsWith("-") && args[i].length() > 1) {
				String key = args[i].substring(1);
				String value = "";
				if (i + 1 < args.length && !args[i + 1].startsWith("-")) {
					value = args[++i];
				}
				retval.setProperty(key, value);
			}
		}
		return retval;
	}
175034
static Properties argumentsToProperties(String[] args) {
    Properties props = new Properties();
    for (String arg : args) {
      if (!arg.startsWith("-D") || !arg.contains("=")) {
        throw new IllegalArgumentException(String.format(
          "Command-line argument must start with -D, for example -Dsonar.jdbc.username=sonar. Got: %s", arg));
      }
      String key = StringUtils.substringBefore(arg, "=").substring(2);
      String value = StringUtils.substringAfter(arg, "=");
      props.setProperty(key, value);
    }
    return props;
  }
411787
public static void setProperties(ArgumentUnit argumentUnit, Properties properties)
            throws IllegalArgumentException
    {
        if (argumentUnit == null) {
            throw new IllegalArgumentException("argumentUnit is null");
        }

        if (properties == null) {
            throw new IllegalArgumentException("properties is null");
        }

        argumentUnit.setProperties(propertiesToString(properties));
    }