Implement command line interface for OpenOrienteering Mapper#2523
Implement command line interface for OpenOrienteering Mapper#2523mfbehrens wants to merge 12 commits into
Conversation
Why is there not .clang-format :(
b4e0edd to
e3702b2
Compare
- QPA_PLATFORM on Linux - include `core/map_printer.h` for Android build
|
I also created a Docker/Podman Container for executing the mapper CLI. It is just the Edit: fixed link |
|
@mfbehrens: the link to your repo at codeberg is not accessible, I assume due to missing access rights. |
|
Thank you. I fixed it. No I was apparently not able to copy a link 😆 |
dg0yt
left a comment
There was a problem hiding this comment.
From a cursory review, it looks very good to me.
With regard to #795, I would like to ensure that the default for PDF takes the graphics/printing path.
The initial post lists OGR-export-DXF, so there could be <prefix>PDF in order to choose the other path. (We should avoid the term OGR because it is somewhat obsolete in modern GDAL.)
I also wonder if CLI and GUI should really be one binary in Windows. We should at least test that it works sufficiently.
|
Any chance one can take this opportunity to make the Mapper binary lowercase by default? |
Documentation aside, this is an orthogonal concern and shouldn't be handled in this PR. |
This is ensured by I would consider any changes/bugs in these format_ids/FileTypeRegistry seperate from this pr. I implemented a listFileFormats to better debug the formats and also for the users to have a source of documentation
I think we can definitively disable the cli on android. I just managed to download the ci build artefact and install them on my Windows 11 vm. The reason I put the cli into the main binary is that there are no shared objects on Linux and macOS.
I think this would be a good thing (except for backwards compatibility). However, if this is a controversial change (renaming has never been controversion lol), please discuss it in a seperate issue. |
The reason I think it's relevant here is that making a switch like this is probably much harder once there is an established CLI. |
Sorry, I missed that 🤦
This is what I expected. A windows executable is either a GUI app or a console program. The Mapper executable is a GUI app. This the |
Fixes #2345
I am glad to receive some feedback.
Its been some time that I worked on QT projects 😅
Tiny Documentation
Documentation yet to come but this is a overview:
Early documentation: OpenOrienteering/mapper-manual#79
Other cli designs
I was thinking about using another propsed format
Mapper mymap.omap --cli export -o mymap.pdfThis approach is ugly to handle.
What happens if the user provides multiple inputs at once?
What if you have a command does not receive an input file?
Or what if it needs to receive two?
What kind of backwards compatibility does this give you? (none because there is no previous cli)
Also a very unusual cli design in general, when you compare it to any other clis (at least on gnu/linux)
In the end it does not really change anything except for you not beeing able to open a file called
--cli(however, I am not really sure if this was possible before and you should probably give your file a better name)Known issues
.omapand.xmapare currently not an output format but it is simply decided by their file extension what happens to the outputMapper --cli convert --helpdisplays wrong application name--clihas to be placed as first argument -> qt args like -platform cannot be setPlease squash merge this