Changeset 2821 in josm for trunk


Ignore:
Timestamp:
2010-01-12T07:11:57+01:00 (10 years ago)
Author:
Gubaer
Message:

applied #4344: patch by bomm: simplify command line processing

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r2820 r2821  
    1111import java.net.Authenticator;
    1212import java.net.ProxySelector;
    13 import java.util.Arrays;
    1413import java.util.Collection;
    1514import java.util.HashMap;
     
    116115
    117116        // construct argument table
    118         List<String> argList = Arrays.asList(argArray);
    119117        final Map<String, Collection<String>> args = new HashMap<String, Collection<String>>();
    120118        for (String arg : argArray) {
     119            if ("-h".equals(arg) || "-?".equals(arg)) {
     120                arg = "--help";
     121            }
     122            // handle simple arguments like file names, URLs, bounds
    121123            if (!arg.startsWith("--")) {
    122124                arg = "--download="+arg;
     
    149151
    150152        // asking for help? show help and exit
    151         if (argList.contains("--help") || argList.contains("-?") || argList.contains("-h")) {
     153        if (args.containsKey("help")) {
    152154            showHelp();
    153155            System.exit(0);
Note: See TracChangeset for help on using the changeset viewer.