Ticket #4344: josm-cmdline.patch

File josm-cmdline.patch, 1.6 KB (added by bomm, 13 years ago)
  • src/org/openstreetmap/josm/gui/MainApplication.java

    diff --git a/src/org/openstreetmap/josm/gui/MainApplication.java b/src/org/openstreetmap/josm/gui/MainApplication.java
    index 0a8217e..45ff122 100644
    a b import java.awt.event.WindowAdapter; 
    1010import java.awt.event.WindowEvent;
    1111import java.net.Authenticator;
    1212import java.net.ProxySelector;
    13 import java.util.Arrays;
    1413import java.util.Collection;
    1514import java.util.HashMap;
    1615import java.util.LinkedList;
    17 import java.util.List;
    1816import java.util.Map;
    1917
    2018import javax.swing.JFrame;
    public class MainApplication extends Main { 
    112110        Main.platform.preStartupHook();
    113111
    114112        // construct argument table
    115         List<String> argList = Arrays.asList(argArray);
    116113        final Map<String, Collection<String>> args = new HashMap<String, Collection<String>>();
    117114        for (String arg : argArray) {
     115            if ("-h".equals(arg) || "-?".equals(arg)) {
     116                arg = "--help";
     117            }
     118            // handle simple arguments like file names, URLs, bounds
    118119            if (!arg.startsWith("--")) {
    119120                arg = "--download="+arg;
    120121            }
    public class MainApplication extends Main { 
    145146        OAuthAccessTokenHolder.getInstance().init(Main.pref, CredentialsManagerFactory.getCredentialManager());
    146147
    147148        // asking for help? show help and exit
    148         if (argList.contains("--help") || argList.contains("-?") || argList.contains("-h")) {
     149        if (args.containsKey("help")) {
    149150            showHelp();
    150151            System.exit(0);
    151152        }