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: RESOLVED MOVED
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: 2019-02-16 13:30 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.
Comment 1 GitLab Migration User 2019-02-16 13:30:18 UTC
-- GitLab Migration Automatic Message --

This bug has been migrated to freedesktop.org's GitLab instance and has been closed from further activity.

You can subscribe and participate further through the new bug through this link to our GitLab instance: https://gitlab.freedesktop.org/xdg/xdg-utils/issues/40.


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.