-
Notifications
You must be signed in to change notification settings - Fork 1.7k
[WSLC] Add 'wslc version' subcommand #14547
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
Merged
Merged
Changes from 11 commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
3e4738a
[WSLC] Add 'wslc version' subcommand
a81125a
Merge branch 'feature/wsl-for-apps' into user/ptrivedi/cli-version
ptrivedi 660b493
[WSLC] Fix E2E help/invalid-command tests after version subcommand ad…
70b1e83
[WSLC] Add E2E version command test and strengthen unit test
bf04c87
Mark 'context' as UNREFERENCED_PARAMETER in
86a999c
Merge branch 'feature/wsl-for-apps' into user/ptrivedi/cli-version
ptrivedi 33ca5d1
Merge branch 'feature/wsl-for-apps' into user/ptrivedi/cli-version
ptrivedi f8fa60f
Merge branch 'feature/wsl-for-apps' into user/ptrivedi/cli-version
ptrivedi 182b0d9
Address PR feedback on wslc version command
aa540ef
Merge remote-tracking branch 'origin/feature/wsl-for-apps' into user/…
4faa8a8
Fix build: add missing using namespace wsl::shared
ea4e4d4
Merge remote-tracking branch 'origin/feature/wsl-for-apps' into user/…
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,40 @@ | ||
| /*++ | ||
|
|
||
| Copyright (c) Microsoft. All rights reserved. | ||
|
|
||
| Module Name: | ||
|
|
||
| VersionCommand.cpp | ||
|
|
||
| Abstract: | ||
|
|
||
| Implementation of the version command. | ||
|
|
||
| --*/ | ||
| #include "VersionCommand.h" | ||
|
|
||
| using namespace wsl::shared; | ||
| using namespace wsl::windows::wslc::execution; | ||
|
|
||
| namespace wsl::windows::wslc { | ||
| std::wstring VersionCommand::ShortDescription() const | ||
| { | ||
| return Localization::WSLCCLI_VersionDesc(); | ||
| } | ||
|
|
||
| std::wstring VersionCommand::LongDescription() const | ||
| { | ||
| return Localization::WSLCCLI_VersionLongDesc(); | ||
| } | ||
|
|
||
| void VersionCommand::PrintVersion() | ||
| { | ||
| wsl::windows::common::wslutil::PrintMessage(std::format(L"{} {}", s_ExecutableName, WSL_PACKAGE_VERSION)); | ||
| } | ||
ptrivedi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
|
||
| void VersionCommand::ExecuteInternal(CLIExecutionContext& context) const | ||
| { | ||
ptrivedi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| UNREFERENCED_PARAMETER(context); | ||
| PrintVersion(); | ||
| } | ||
ptrivedi marked this conversation as resolved.
Show resolved
Hide resolved
|
||
| } // namespace wsl::windows::wslc | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,31 @@ | ||
| /*++ | ||
|
|
||
| Copyright (c) Microsoft. All rights reserved. | ||
|
|
||
| Module Name: | ||
|
|
||
| VersionCommand.h | ||
|
|
||
| Abstract: | ||
|
|
||
| Declaration of the VersionCommand. | ||
|
|
||
| --*/ | ||
| #pragma once | ||
| #include "Command.h" | ||
|
|
||
| namespace wsl::windows::wslc { | ||
| struct VersionCommand final : public Command | ||
| { | ||
| constexpr static std::wstring_view CommandName = L"version"; | ||
| VersionCommand(const std::wstring& parent) : Command(CommandName, parent) | ||
| { | ||
| } | ||
| static void PrintVersion(); | ||
| std::wstring ShortDescription() const override; | ||
| std::wstring LongDescription() const override; | ||
|
|
||
| protected: | ||
| void ExecuteInternal(CLIExecutionContext& context) const override; | ||
| }; | ||
| } // namespace wsl::windows::wslc |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.