Skip to content
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

\" (backSlash double quotes) is treating as a literal, when java process issues command to the the Linux TFS command line client #321

Open
hssom opened this issue Sep 1, 2020 · 1 comment

Comments

@hssom
Copy link

hssom commented Sep 1, 2020

Hi,

In our java application, the java process is contructing command for linux TFS command line client, for a collection URL having space, by escaping double quotes around TFS collection URL as,

tf dir -login:username,Password! -collection:"http://appserver:8080/tfs/default collection" -recursive $/"test spaceNew"

The following is the error occured:

An argument error occurred: Option 'collection' requires a full URL as its value: no protocol: "http://appserver:8080/tfs/default
Team Explorer Everywhere Command Line Client (version 14.134.0.201804261732)

Note: The same command issued to windows TFS command line client works.

So, it is observed that " (backSlash double quotes) sequence is not escaping the double quotes, instead it is treating as a literal.

Please let me know, is there any solution for this.
Thank you.

@ForNeVeR
Copy link

ForNeVeR commented Sep 2, 2020

Rules for escaping are different depending on how are you calling the client.

On Linux, all the corresponding APIs have the list-styled syntax, so you're actually supposed to do an equivalent of

execute("tf", "dir", "-login:username,Password!", "-collection:http://appserver:8080/tfs/default collection", "-recursive $/test spaceNew");

(note the quote placement!)

On Windows, where the corresponding APIs are string-based (i.e. are taking a single strings instead of a list of strings), there's a standard command-line parsing convention, which will do the same transformation for you (e.g. your -collection:"http://appserver:8080/tfs/default collection" will became "-collection:http://appserver:8080/tfs/default collection" according to it). That's why it works for you on Windows, but not on Linux.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants