-
-
Notifications
You must be signed in to change notification settings - Fork 276
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Bug]: Bottles CLI issue passing arguments (not escaping correctly) #2080
Comments
I'm not able to replicate, doing:
works as expected. |
I mean if the application requires a dash - flag;
in this case the -a -b -c are evaluated by bottles-cli and not escaped to be passed to the application. |
Still having an issue with this. This is an example of the issue I'm having: flatpak run --command=bottles-cli com.usebottles.bottles -b bottle -p application -a '-a "123e4567-e89b-12d3-a456-426614174000"' The application takes a variable via the same -a argument, but it's instead evaluated by bottles-cli. The problem is the application expects the variable passed to -a is quoted too. I need a way of escaping it. Is there anyway to get this to work? |
Hi gr225, I just developed a workaround for a similar problem (Bottles passing incorrect arguments to Windows programs) by pre-processing the arguments in the CLI command. Maybe you can adapt my solution. Please see How to click on a file in Linux and have a Bottles Windows program open and load that file Good luck... |
Thanks - not sure this will work for this particular application unfortunately. I'm not sure that we can really 'escape' the -a parameter. The application requires -a to take the variable I'm passing to it, but there's no way to stop bottles-cli assuming it's for itself. One solution I can think of is if bottles-cli could still run the configured start parameter for that bottles application (which could be set at -a in this case), and then extra variables can be 'added' by the command -a in the cli. |
Maybe you can escape the -a with a backslash. Here's what I tried. I started Word from the command line with this:
Then, in Word, I used a short VBA to print out the command line used to start Word, and I got this:
So it appears the arguments were passed in as expected. |
Using Bottles 51.11, the escaped arguments now seem to get passed to vmtouch instead.
results in
|
Describe the bug
There is an issue with the arguments (-a) parameter in "bottles-cli run" in which it will not escape if the executable also uses a dash (-) parameter (argument). It assumes it's part of the bottles-cli command instead.
Passing an argument via the configuration file works, but not via CLI. It's important that bottles-cli escapes the argument so that more complex scripting can send a variable to the application running in bottles.
This is preventing me from running a particular application which otherwise works fantastic in bottles. Unfortunately the application requires a command line parameter with a dash and then a variable to be injected from MIME URL.
Maybe I'm missing something, or if not, then hopefully a solution can be found to allow us to pass these types of arguments.
To Reproduce
The issue can be reproduced with an application that requires the use of a dash-based argument, even if it's the same. Enclosing in quotes should escape it. I've tried single quotes and \ to escape but nothing works.
bottles-cli run -b testbottle -p testapp -a "-a variable"
bottles-cli run -b testbottle -p testapp -a "-z"
bottles-cli run -b testbottle -p testapp -a "-launch"
Bottles returns an error regarding unexpected argument.
Package
Flatpak from Flathub
Distribution
Fedora 36
Troubleshooting Logs
Display Protocol
Wayland
Display Backend used by Bottles
Wayland
Additional context
No response
The text was updated successfully, but these errors were encountered: