diff --git a/src/windows/wslc/commands/ContainerStopCommand.cpp b/src/windows/wslc/commands/ContainerStopCommand.cpp index f66ccfdff..b3af2c474 100644 --- a/src/windows/wslc/commands/ContainerStopCommand.cpp +++ b/src/windows/wslc/commands/ContainerStopCommand.cpp @@ -27,7 +27,7 @@ namespace wsl::windows::wslc { std::vector ContainerStopCommand::GetArguments() const { return { - Argument::Create(ArgType::ContainerId, std::nullopt, NO_LIMIT), + Argument::Create(ArgType::ContainerId, true, NO_LIMIT), Argument::Create(ArgType::Signal), Argument::Create(ArgType::Time), }; diff --git a/test/windows/wslc/CommandLineTestCases.h b/test/windows/wslc/CommandLineTestCases.h index ea35e27a4..8877c2903 100644 --- a/test/windows/wslc/CommandLineTestCases.h +++ b/test/windows/wslc/CommandLineTestCases.h @@ -95,7 +95,8 @@ COMMAND_LINE_TEST_CASE(L"container run ubuntu", L"run", true) COMMAND_LINE_TEST_CASE(L"container run --cidfile C:\\temp\\cidfile ubuntu", L"run", true) COMMAND_LINE_TEST_CASE(L"container run -it --name foo ubuntu", L"run", true) COMMAND_LINE_TEST_CASE(L"container run --rm -it --name foo ubuntu", L"run", true) -COMMAND_LINE_TEST_CASE(L"stop", L"stop", true) +COMMAND_LINE_TEST_CASE(L"stop", L"stop", false) // Missing required container-id positional +COMMAND_LINE_TEST_CASE(L"container stop", L"stop", false) // Missing required container-id positional COMMAND_LINE_TEST_CASE(L"container stop cont1 --signal 9", L"stop", true) COMMAND_LINE_TEST_CASE(L"container stop cont1 --signal SIGALRM", L"stop", true) COMMAND_LINE_TEST_CASE(L"container stop cont1 --signal sigkill", L"stop", true)