vscode-perforce icon indicating copy to clipboard operation
vscode-perforce copied to clipboard

Perforce client error: Invalid option -q

Open rjohnson13 opened this issue 4 years ago • 2 comments

Describe the bug: When initially starting, the extension fails due to a bad p4 command. Here is the error I get from the perforce logs:

file:///p4ws/fpga/rojohnson/tb_dev: Looking for perforce config files /p4ws/fpga/rojohnson/tb_dev: p4 '-u' 'username' '-P' '"password"' 'set' '-q' Error: Perforce client error: p4 -h for usage. Invalid option: -q.

Expected behavior: The extension would correctly call the p4 set command and detect my client.

To Reproduce: Open remote ssh VSCode window with Remote - SSH extension. Open the perforce workspace folder. Check the perforce logs.

Versions & Details:

  • Perforce extension: v4.15.2
  • VSCode version: 1.59
  • Operating System: Windows 10
  • Perforce server details (if known): Rev. P4/LINUX26X86_64/2015.1/1227227 (2015/08/27)
  • Are you using a multi-root workspace?: No

Additional context

I believe this to be a perforce versioning issue. My perforce server is currently running an outdated version, so its possible the syntax of p4 set has changed. From a command line, "p4 set -q" gives me the exact same error. However, "p4 -q set" does not give me an error and acts as I would expect.

Please open view -> Output, select "Perforce Log" from the dropdown and paste it here, if possible / relevant

Performing one-time registration of perforce commands

Workspace folders changed. Starting initialisation.

Workspaces were added

file:///root/to/client: Trying to initialise SCM Providers in this workspace. Note: the following overrides apply in this workspace: perforce.port: (will not override) perforce.user: username (!OVERRIDE!) perforce.client: (will not override) perforce.dir: (will not override) Explicit overrides may prevent auto-detection of other perforce client workspaces Looking for a client root using the workspace root directory /root/to/client: p4 '-u' 'username' '-P' '"password"' 'info' file:///root/to/client Found workspace using root directory

  • VS Code workspace root directory : Client name: client Client root: /root/to/client User name: username Server address: servername.com:1666 Folder IS in or above client root

file:///root/to/client: Looking for perforce config files /root/to/client p4 '-u' 'username' '-P' '"password"' 'set' '-q' Error: Perforce client error: p4 -h for usage. Invalid option: -q.

Initialisation finished

rjohnson13 avatar Aug 05 '21 22:08 rjohnson13

Thanks for raising - Yes I believe this is a bug in certain old command line client versions (not the server - this command doesn't touch the server iirc). See https://github.com/mjcrouch/vscode-perforce/issues/53

From a command line, "p4 set -q" gives me the exact same error. However, "p4 -q set" does not give me an error and acts as I would expect.

Flags directly after p4 and before the command are g-opts which have a different meaning. The -q g-opt is quiet mode while p4 set -q adjusts the formatting to make it easier to parse.

If you have control of the software on your computer I would recommend trying a newer version of the p4 cli - it should be backward compatible.. I think

mjcrouch avatar Aug 05 '21 22:08 mjcrouch

Thank you for linking the other issue #53. I tried to scan for similar issues but did not go into the issue to see that it is the same one. This is probably a duplicate issue then unless you think it adds more info towards this issue.

And thanks for the reply! I figured it was a versioning issue. I don't have full control over this server's software, but I can bring this up with those who do to see if its possible to upgrade.

rjohnson13 avatar Aug 05 '21 22:08 rjohnson13