Java Args Parse parseArgs(String argvStart, String[] args)

Here you can find the source of parseArgs(String argvStart, String[] args)

Description

parse Args

License

Open Source License

Declaration

public static Map<String, String> parseArgs(String argvStart, String[] args) 

Method Source Code

//package com.java2s;

import java.util.HashMap;

import java.util.Map;

public class Main {
    public static Map<String, String> parseArgs(String argvStart, String[] args) {
        Map<String, String> rs = new HashMap<String, String>();

        for (int i = 0; i < args.length; i++) {
            String arg = args[i];
            String v = ((i < args.length - 1) && !args[i + 1].startsWith(argvStart)) ? args[++i] : null;
            arg = arg.substring(argvStart.length());
            rs.put(arg, v);/*from  ww w.  ja  v a  2 s .  c  o  m*/
        }
        return rs;
    }
}

Related

  1. getPossibleCompletionsForGivenArgs(String[] args, String[] possibilitiesOfCompletion)
  2. parse(String[] args)
  3. parse(String[] args)
  4. parseAndFillFittingValues(String[] prefixes, String[] values)
  5. parseArg(String[] args)
  6. parseArgs(String[] args)
  7. parseArgs(String[] args)
  8. parseArgs(String[] args)
  9. parseArgs(String[] args)