question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Support JCommander-style parameter files

See original GitHub issue

It is possible that this is a feature, but I did not find it in the documentation. See my Github repo for a complete reproducer.

Steps to reproduce

Create an argument file argFile such as this:

-f "C:\Users\me\somefile.txt"

Run Picocli like this:

CommandLine.run(..., "@argFile");

Observe that the value of the String-typed Option has been changed to C:UsersmesomeFile.txt.

Additional information

  • When the value is not quoted, everything works fine. This suggests a problem with not escaping the Windows backslash character. However, the quotes are used in order not to have to escape whitespace characters and therefore this workaround creates a different problem - either I escape the backslashes or the whitespace.
  • When the value is kept quoted but passed directly on the command line (as opposed to the argument file), the problem no longer shows up. Unfortunately, the code will include the quotes in the resulting value. There is a second test included to showcase that problem.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:28 (28 by maintainers)

github_iconTop GitHub Comments

1reaction
remkopcommented, Nov 28, 2018

I was thinking this weekend.

1reaction
remkopcommented, Nov 20, 2018

About the second issue you mention, that " quote values are preserved when specified on the command line: this is by design but is configurable.

You can switch this off with commandLine.setTrimQuotes(true).

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to create and use Parameter files? - Forums - IBM Support
I know how to set parameters in the Jobs and Sequences. But in that I have enter these parameters during run time. My...
Read more >
Parameter Files - Oracle Help Center
Create the parameter file using any flat file text editor. The command-line option PARFILE= filename tells Export to read the parameters from the...
Read more >
Create Resource Manager parameter file - Azure
Create parameter file for passing in values during deployment of an Azure Resource Manager template.
Read more >
Manage Parameter Files
You can customize and import parameter XML files for devices. ... Note: The Universal Device Manager does not support the getAll command for...
Read more >
HOW TO : Use Parameter Files with startworkflow on different ...
Integration Service runs the workflow using the parameters in the file you specify. For UNIX shell users, enclose the parameter file name in ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found