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

WSL 2: wsl --shutdown accepts extra cmdline arguments #4539

Closed
swarren opened this issue Sep 23, 2019 · 3 comments
Closed

WSL 2: wsl --shutdown accepts extra cmdline arguments #4539

swarren opened this issue Sep 23, 2019 · 3 comments
Labels

Comments

@swarren
Copy link

swarren commented Sep 23, 2019

wsl --shutdown is the entire legal command according to wsl --help. However, if I actually type wsl --shutdown Ubuntu (i.e. when I get confused about which of --shutdown and --terminate is which), no error is issued. There should be an error, because Ubuntu is not an expected parameter to --shutdown.

Put another way. Actual behaviour:

c:\> wsl --shutdown foo
c:\> 

Expected behaviour:

c:\> wsl --shutdown foo
Error: Unknown argument "foo"
c:\> 

(No doubt this is happening because other cmdline options in wsl allow launching an arbitrary command within the WSL VM. However, --shutdown doesn't allow this, so shouldn't accept the meaningless/unused command argument.)

Windows build number: 10.0.18985.1

@therealkenc
Copy link
Collaborator

so shouldn't accept the meaningless/unused command argument

That's pretty normal

$ gcc --version foo
gcc (Ubuntu 8.3.0-6ubuntu1) 8.3.0
Copyright (C) 2018 Free Software Foundation, Inc.
This is free software; see the source for copying conditions.  There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

No error on superfluous foo argument.

@swarren
Copy link
Author

swarren commented Sep 24, 2019

I think the fact gcc has the same issue doesn't mean it isn't a bug. Admittedly, --version and --help often do have this quirk, but it's rare for other options in my experience.

@Biswa96
Copy link

Biswa96 commented Sep 24, 2019

shutdown option does not accept any argument. It kills all running Lx session. Try that option with running WSL1 and WSL2 distribution simultaneously.

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

No branches or pull requests

4 participants