diff --git a/src/AppInstallerCLICore/Argument.cpp b/src/AppInstallerCLICore/Argument.cpp index 68ecad1ee1..a871a3b387 100644 --- a/src/AppInstallerCLICore/Argument.cpp +++ b/src/AppInstallerCLICore/Argument.cpp @@ -105,6 +105,7 @@ namespace AppInstaller::CLI void Argument::GetCommon(std::vector& args) { args.push_back(ForType(Args::Type::Help)); + args.push_back(ForType(Args::Type::Wait)); args.push_back(ForType(Args::Type::NoVT)); args.push_back(ForType(Args::Type::RainbowStyle)); args.push_back(ForType(Args::Type::RetroStyle)); diff --git a/src/AppInstallerCLICore/Command.cpp b/src/AppInstallerCLICore/Command.cpp index 41e767d0cd..aa5f993dc8 100644 --- a/src/AppInstallerCLICore/Command.cpp +++ b/src/AppInstallerCLICore/Command.cpp @@ -808,6 +808,10 @@ namespace AppInstaller::CLI { ExecuteInternal(context); } + if (context.Args.Contains(Execution::Args::Type::Wait)) + { + context.Reporter.PromptForEnter(); + } } void Command::ValidateArgumentsInternal(Execution::Args&) const diff --git a/src/AppInstallerCLICore/Commands/RootCommand.cpp b/src/AppInstallerCLICore/Commands/RootCommand.cpp index 098878d6fa..e5b19ab15c 100644 --- a/src/AppInstallerCLICore/Commands/RootCommand.cpp +++ b/src/AppInstallerCLICore/Commands/RootCommand.cpp @@ -160,6 +160,11 @@ namespace AppInstaller::CLI { ExecuteInternal(context); } + + if (context.Args.Contains(Execution::Args::Type::Wait)) + { + context.Reporter.PromptForEnter(); + } } void RootCommand::ExecuteInternal(Execution::Context& context) const @@ -198,7 +203,7 @@ namespace AppInstaller::CLI } else if (context.Args.Contains(Execution::Args::Type::ListVersions)) { - context.Reporter.Info() << 'v' << Runtime::GetClientVersion(); + context.Reporter.Info() << 'v' << Runtime::GetClientVersion() << std::endl; } else { diff --git a/src/AppInstallerCLICore/ExecutionReporter.cpp b/src/AppInstallerCLICore/ExecutionReporter.cpp index 67324b312e..c70e78a858 100644 --- a/src/AppInstallerCLICore/ExecutionReporter.cpp +++ b/src/AppInstallerCLICore/ExecutionReporter.cpp @@ -156,6 +156,13 @@ namespace AppInstaller::CLI::Execution } } + void Reporter::PromptForEnter(Level level) + { + auto out = GetOutputStream(level); + out << std::endl << Resource::String::PressEnterToContinue << std::endl; + m_in.get(); + } + void Reporter::ShowIndefiniteProgress(bool running) { if (m_spinner) diff --git a/src/AppInstallerCLICore/ExecutionReporter.h b/src/AppInstallerCLICore/ExecutionReporter.h index 9aac540e43..e262f44a6a 100644 --- a/src/AppInstallerCLICore/ExecutionReporter.h +++ b/src/AppInstallerCLICore/ExecutionReporter.h @@ -99,6 +99,9 @@ namespace AppInstaller::CLI::Execution // Prompts the user, return true if they consented. bool PromptForBoolResponse(Resource::LocString message, Level level = Level::Info); + // Prompts the user, continues when Enter is pressed + void PromptForEnter(Level level = Level::Info); + // Used to show indefinite progress. Currently an indefinite spinner is the form of // showing indefinite progress. // running: shows indefinite progress if set to true, stops indefinite progress if set to false diff --git a/src/AppInstallerCLICore/Resources.h b/src/AppInstallerCLICore/Resources.h index f58c89bde1..05c569828b 100644 --- a/src/AppInstallerCLICore/Resources.h +++ b/src/AppInstallerCLICore/Resources.h @@ -219,6 +219,7 @@ namespace AppInstaller::CLI::Resource WINGET_DEFINE_RESOURCE_STRINGID(PortableRegistryCollisionOverridden); WINGET_DEFINE_RESOURCE_STRINGID(PositionArgumentDescription); WINGET_DEFINE_RESOURCE_STRINGID(PreserveArgumentDescription); + WINGET_DEFINE_RESOURCE_STRINGID(PressEnterToContinue); WINGET_DEFINE_RESOURCE_STRINGID(PrivacyStatement); WINGET_DEFINE_RESOURCE_STRINGID(ProductCodeArgumentDescription); WINGET_DEFINE_RESOURCE_STRINGID(PromptOptionNo); diff --git a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw index 26ae27db7e..5f91b1d040 100644 --- a/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw +++ b/src/AppInstallerCLIPackage/Shared/Strings/en-us/winget.resw @@ -1284,6 +1284,9 @@ Please specify one of them using the `--source` option to proceed. Deletes all files and directories in the package directory (portable) + + Press Enter to continue . . . + The value to rename the executable file (portable)