Bug 32973 - xdg-open fails to handle file names beginning with - (missing -- option) [PATCH]
Summary: xdg-open fails to handle file names beginning with - (missing -- option) [PATCH]
Status: NEW
Alias: None
Product: Portland
Classification: Unclassified
Component: xdg-utils (show other bugs)
Version: unspecified
Hardware: All All
: medium normal
Assignee: Portland Bugs
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-01-10 08:50 UTC by Rüdiger
Modified: 2011-01-11 17:16 UTC (History)
1 user (show)

See Also:
i915 platform:
i915 features:


Attachments
Patch (2.61 KB, patch)
2011-01-10 08:50 UTC, Rüdiger
Details | Splinter Review

Note You need to log in before you can comment on or make changes to this bug.
Description Rüdiger 2011-01-10 08:50:38 UTC
Created attachment 41851 [details] [review]
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.


Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.