Changeset 17637 in josm for trunk/src/org


Ignore:
Timestamp:
2021-03-22T19:30:36+01:00 (4 years ago)
Author:
simon04
Message:

fix #20647 - Add --status-report command line argument

Location:
trunk/src/org/openstreetmap/josm
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/actions/ShowStatusReportAction.java

    r17337 r17637  
    6464
    6565    /**
     66     * Localized description text for this action
     67     */
     68    public static final String ACTION_DESCRIPTION = tr("Show status report with useful information that can be attached to bugs");
     69
     70    /**
    6671     * Constructs a new {@code ShowStatusReportAction}
    6772     */
     
    7075                tr("Show Status Report"),
    7176                "misc/statusreport",
    72                 tr("Show status report with useful information that can be attached to bugs"),
     77                ACTION_DESCRIPTION,
    7378                Shortcut.registerShortcut("help:showstatusreport", tr("Help: {0}",
    7479                        tr("Show Status Report")), KeyEvent.CHAR_UNDEFINED, Shortcut.NONE), true, "help/showstatusreport", false);
  • trunk/src/org/openstreetmap/josm/gui/MainApplication.java

    r17556 r17637  
    7171import org.openstreetmap.josm.actions.PreferencesAction;
    7272import org.openstreetmap.josm.actions.RestartAction;
     73import org.openstreetmap.josm.actions.ShowStatusReportAction;
    7374import org.openstreetmap.josm.actions.downloadtasks.DownloadGpsTask;
    7475import org.openstreetmap.josm.actions.downloadtasks.DownloadOsmTask;
     
    657658                "\t--language=<language>                     "+tr("Set the language")+"\n\n"+
    658659                "\t--version                                 "+tr("Displays the JOSM version and exits")+"\n\n"+
     660                "\t--status-report                           "+ShowStatusReportAction.ACTION_DESCRIPTION+"\n\n"+
    659661                "\t--debug                                   "+tr("Print debugging messages to console")+"\n\n"+
    660662                "\t--skip-plugins                            "+tr("Skip loading plugins")+"\n\n"+
     
    730732        Level logLevel = args.getLogLevel();
    731733        Logging.setLogLevel(logLevel);
    732         if (!args.showVersion() && !args.showHelp()) {
     734        if (!args.hasOption(Option.VERSION) && !args.hasOption(Option.STATUS_REPORT) && !args.showHelp()) {
    733735            Logging.info(tr("Log level is at {0} ({1}, {2})", logLevel.getLocalizedName(), logLevel.getName(), logLevel.intValue()));
    734736        }
     
    772774        Config.setUrlsProvider(JosmUrls.getInstance());
    773775
    774         if (args.showVersion()) {
     776        if (args.hasOption(Option.VERSION)) {
    775777            System.out.println(Version.getInstance().getAgentString());
     778            return;
     779        } else if (args.hasOption(Option.STATUS_REPORT)) {
     780            System.out.println(ShowStatusReportAction.getReportHeader());
    776781            return;
    777782        } else if (args.showHelp()) {
  • trunk/src/org/openstreetmap/josm/gui/ProgramArguments.java

    r16446 r17637  
    3535        /** --version                                  Displays the JOSM version and exits */
    3636        VERSION(false),
     37        /** {@code --status-report} Show status report with useful information that can be attached to bugs */
     38        STATUS_REPORT(false),
    3739        /** --debug                                    Print debugging messages to console */
    3840        DEBUG(false),
Note: See TracChangeset for help on using the changeset viewer.