Modify

Opened 2 weeks ago

Closed 2 weeks ago

Last modified 2 weeks ago

#15273 closed enhancement (fixed)

extend command line interface: keywords

Reported by: bastiK Owned by: team
Priority: normal Milestone: 17.09
Component: Core Version:
Keywords: Cc:

Description

It would be useful to have access to certain JOSM features via command line, e.g. validation (#15182), projection, rendering (#15229). For this purpose, I suggest the following extended syntax:

java -jar josm.jar <keyword> <options> <args>

So for instance to use projection or rendering features, it would be

java -jar josm.jar projection -v +init=epsg:4326 +to +init=epsg:3857 <input.txt
java -jar josm.jar rendering -i data.osm --style style.mapcss --zoom 16 --box ... -o img.jpg

The current command line features are accessed with the josm keyword, which is the default and optional. Both of the following starts JOSM and opens the file track1.gpx:

java -jar josm.jar josm track1.gpx
java -jar josm.jar track1.gpx

If we have separate jar files for modules in the future, then you would simply drop the keyword:

java -jar josm-projection.jar -v +init=epsg:4326 +to +init=epsg:3857 <input.txt
java -jar josm-rendering.jar -i data.osm --style style.mapcss --zoom 16 --box ... -o img.jpg

Attachments (0)

Change History (7)

comment:1 Changed 2 weeks ago by stoecker

Hmm. That's very complex to understand and we don't have so many options. I made tools with 50 or more options and they have a shortage of shortcut letters, but josm is far away from that limit.

I'd suggest to simply ensure that different parts don't have conflicting options.

comment:2 in reply to:  1 Changed 2 weeks ago by bastiK

Replying to stoecker:

Hmm. That's very complex to understand and we don't have so many options.

It mimics apt-get update|upgrade|install, svn status|commit, etc. In a similar way, the different JOSM subcommands have very little in common.

I'd suggest to simply ensure that different parts don't have conflicting options.

Still you need to tell it what to do. Instead of josm rendering ... it would be josm --action=rendering or josm --rendering, which is hardly any simpler.

comment:3 Changed 2 weeks ago by Don-vip

I like the idea but not the wording. The commands should not describe the underlying module (validation, rendering) but the action offered: validate, render. You don't say "apt-get updating" ;)

comment:4 Changed 2 weeks ago by bastiK

Resolution: fixed
Status: newclosed

In 12792/josm:

closes #15273, see #15229, see #15182 - add command line interface module for projections

  • run josm project --help to see the options
  • extracts parser from LatLon and CustomProjection into LatLonParser

comment:5 Changed 2 weeks ago by bastiK

Milestone: 17.09

The normal command line help text needs to be updated to let the users know about the feature, but I'll let it settle a bit.

comment:6 Changed 2 weeks ago by bastiK

In 12793/josm:

see #15273, see #15229, see #15182 - add missing class

comment:7 Changed 2 weeks ago by bastiK

In 12795/josm:

see #15273, see #15229 - fix unit tests, PMD, etc.

Modify Ticket

Change Properties
Set your email in Preferences
Action
as closed The owner will remain team.
as The resolution will be set.
The resolution will be deleted.

Add Comment


E-mail address and name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.