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

--user-data-dir incorrect help #41429

Closed
izznogooood opened this issue Jan 10, 2018 · 6 comments

Comments

@izznogooood
Copy link

commented Jan 10, 2018

  • VSCode Version: 1.19.2
  • OS Version: Arch

Steps to Reproduce:

  1. sudo code --user-data-dir /some/dir

Workaround:

"sudo code --user-data-dir=/some/dir"

Comment:

Djesus crist people, fix the --help list allready!

#7243

@bpasero

This comment has been minimized.

Copy link
Member

commented Jan 11, 2018

@izznogooood I cannot reproduce, for me sudo code --user-data-dir=/some/dir works. What happens in your case?

@izznogooood

This comment has been minimized.

Copy link
Author

commented Jan 11, 2018

Yes that would work. your --help does not inform you to use "--user-data-dir=/some/dir", but "--user-data-dir /some/dir". Your --help is missing a critical piece of information "=" the equal sign.

Hence:
#41430

I hindsight I should apologize for writing a bug report "frustrated".
"Djesus crist people...."

@bpasero

This comment has been minimized.

Copy link
Member

commented Jan 11, 2018

@izznogooood sorry, I confused myself. I meant to say that for me it works without the "=". What happens in your case without the "="? And does it only NOT work with sudo or never?

@izznogooood

This comment has been minimized.

Copy link
Author

commented Jan 11, 2018

Edit: It does work executing without sudo.

Oh I see, well not here ...

[anders@idea ~]$ code --help
Visual Studio Code 1.19.2

Usage: code [options] [paths...]

To read from stdin, append '-' (e.g. 'ps aux | grep code | code -')

Options:
  -d, --diff <file> <file>                                       Compare two files with each other.
  -a, --add <dir>                                                Add folder(s) to the last active window.
  -g, --goto <file:line[:character]>                             Open a file at the path on the specified line and character
                                                                 position.
  --locale <locale>                                              The locale to use (e.g. en-US or zh-TW).
  -n, --new-window                                               Force a new instance of Code.
  -p, --performance                                              Start with the 'Developer: Startup Performance' command enabled.
  --prof-startup                                                 Run CPU profiler during startup
  --inspect-extensions                                           Allow debugging and profiling of extensions. Check the developer
                                                                 tools for the connection uri.
  --inspect-brk-extensions                                       Allow debugging and profiling of extensions with the extension
                                                                 host being paused after start. Check the developer tools for the
                                                                 connection uri.
  -r, --reuse-window                                             Force opening a file or folder in the last active window.
  --user-data-dir <dir>                                          Specifies the directory that user data is kept in, useful when
                                                                 running as root.
  --log <level>                                                  Log level to use. Default is 'info'. Allowed values are
                                                                 'critical', 'error', 'warn', 'info', 'debug', 'trace', 'off'.
  --verbose                                                      Print verbose output (implies --wait).
  -w, --wait                                                     Wait for the files to be closed before returning.
  --extensions-dir <dir>                                         Set the root path for extensions.
  --list-extensions                                              List the installed extensions.
  --show-versions                                                Show versions of installed extensions, when using
                                                                 --list-extension.
  --install-extension (<extension-id> | <extension-vsix-path>)   Installs an extension.
  --uninstall-extension (<extension-id> | <extension-vsix-path>) Uninstalls an extension.
  --enable-proposed-api <extension-id>                           Enables proposed api features for an extension.
  --disable-extensions                                           Disable all installed extensions.
  --disable-gpu                                                  Disable GPU hardware acceleration.
  -s, --status                                                   Print process usage and diagnostics information.
  -v, --version                                                  Print version.
  -h, --help                                                     Print usage.
[anders@idea ~]$ sudo code 
You are trying to start vscode as a super user which is not recommended. If you really want to, you must specify an alternate user data directory using the --user-data-dir argument.
[anders@idea ~]$ sudo code --user-data-dir=/root  <------ ok
[anders@idea ~]$ sudo code --user-data-dir /root
You are trying to start vscode as a super user which is not recommended. If you really want to, you must specify an alternate user data directory using the --user-data-dir argument.
[anders@idea ~]$ sudo su
[root@idea anders]# code --user-data-dir /root
You are trying to start vscode as a super user which is not recommended. If you really want to, you must specify an alternate user data directory using the --user-data-dir argument.
[root@idea anders]# code --user-data-dir=/root <------- ok
[root@idea anders]# 

@bpasero bpasero added bug and removed needs more info labels Jan 12, 2018

@bpasero bpasero added the linux label Jan 12, 2018

@bpasero

This comment has been minimized.

Copy link
Member

commented Jan 12, 2018

I see, I think this is just an issue with our code.sh script, I can fix that.

@bpasero bpasero closed this in 2626602 Jan 12, 2018

@izznogooood

This comment has been minimized.

Copy link
Author

commented Jan 12, 2018

That's great, thanks.

@octref octref added the verified label Feb 1, 2018

@vscodebot vscodebot bot locked and limited conversation to collaborators Feb 26, 2018

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
3 participants
You can’t perform that action at this time.