Skip argument starting with minus sign in shell command

I want to run the following (KDE specific) command with an argument (-0.1) that starts with '-'

kdialog --textinputbox 'Output:' '-0.1'

It is supposed to show a text field with '-0.1', but the command gives

unknown option "-0.1"

while

kdialog --textinputbox 'Output:' '0.1'

works. Obviously, the team is trying to interpret 0.1 as an option. Is there a way to pass the argument "-0.1" to such commands? I tried passing it as a variable that didn't work either!

+3
source share
1 answer

Try:

kdialog --textinputbox 'Output:' -- '-0.1'

-- means "end of options" and should work for all Qt applications (thus KDE) that use the standard argument functions for this structure.

+4
source