Bug 32973

Summary: xdg-open fails to handle file names beginning with - (missing -- option) [PATCH]
Product: Portland Reporter: RĂ¼diger <ruediger>
Component: xdg-utilsAssignee: Portland Bugs <portland-bugs>
Status: RESOLVED MOVED QA Contact:
Severity: normal    
Priority: medium CC: ruediger
Version: unspecified   
Hardware: All   
OS: All   
Whiteboard:
i915 platform: i915 features:
Attachments: Patch

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.