xdg-open fails to handle file names beginning with - (missing -- option) [PATCH]
Submitted by Rüdiger
Assigned to Portland Bugs
Description
Created attachment 41851 Patch
$ cat > -test.txt test ^D $ xdg-open -test.txt xdg-open: unexpected option '-test.txt' Try 'xdg-open --help' for more information. $ xdg-open -- -test.txt xdg-open: unexpected option '--' Try 'xdg-open --help' for more information.
Most applications offer the -- flag to deactivate the handling of options and allow the application to handle file names beginning with -. I wrote a patch that adds support for -- to xdg-open. I added a test case and it worked for me with kde-open (should also work with exo-open and gnome. Haven't tried the generic/lxde stuff).
The patch does not support file names "--help" and so on because the code that handles those options is auto generated and not aware of --. I wasn't sure how to fix that and it's probably a very uncommon use case.
Patch 41851, "Patch":
0001-Added-option-to-support-opening-filenames-beginning-.patch