command-line language setting ignores first character of argument

Issue #23 resolved
ogerboss created an issue

When you want to use the -LANGUAGE parameter to set the language via command-line, the patcher will only use a substring of the supplied argument, because there is a substring call inside. So you need to write -LANGUAGE -GERMAN or -LANGUAGE _GERMAN, which is very counter-intuitive, especially when you are used to command-line tools under linux. :)

So I wonder, if there is some hidden purpose in the substring call (see below, SUMGUI line 511) that I miss?

index = arguments.indexOf("-LANGUAGE");
    if (index != -1) {
        String lang = arguments.get(index + 1).substring(1);
        for (Language l : Language.values()) {
        if (lang.equalsIgnoreCase(l.toString())) {
            SPGlobal.language = l;
            break;
        }
        }
    }

Comments (5)

  1. David Tynan repo owner

    That was an odd decision on Leviathan's part. He did use -Language -theLanguage when passing arguments in SUM. I removed the need for the extra - and changed SUM as well for the next version.

  2. David Tynan repo owner
    • changed status to open

    Realized my fix would break SUM setting language on patchers that used old versions of skyproc. Will have to kludge together support for both.

  3. ogerboss reporter

    If #25 is implemented, this issue should have a really low importance and only affect a handful of nerds (a wrong language-setting in the ini causes CTDs at startup, so this value should be reliable)

  4. Log in to comment