diff --git a/tools/projmgr/src/ProjMgr.cpp b/tools/projmgr/src/ProjMgr.cpp index f27888baf..6168b48b1 100644 --- a/tools/projmgr/src/ProjMgr.cpp +++ b/tools/projmgr/src/ProjMgr.cpp @@ -169,7 +169,7 @@ int ProjMgr::ParseCommandLine(int argc, char** argv) { {"list packs", { true, {context, contextSet, debug, filter, load, missing, quiet, schemaCheck, toolchain, verbose, relativePaths}}}, {"list boards", { true, {context, contextSet, debug, filter, load, quiet, schemaCheck, toolchain, verbose}}}, {"list devices", { true, {context, contextSet, debug, filter, load, quiet, schemaCheck, toolchain, verbose}}}, - {"list configs", { true, {context, contextSet, debug, filter, load, quiet, schemaCheck, toolchain, verbose}}}, + {"list configs", { false, {context, contextSet, debug, filter, load, quiet, schemaCheck, toolchain, verbose}}}, {"list components", { true, {context, contextSet, debug, filter, load, quiet, schemaCheck, toolchain, verbose}}}, {"list dependencies", { false, {context, contextSet, debug, filter, load, quiet, schemaCheck, toolchain, verbose}}}, {"list contexts", { false, {debug, filter, quiet, schemaCheck, verbose, ymlOrder}}}, @@ -788,11 +788,9 @@ bool ProjMgr::RunListComponents(void) { } bool ProjMgr::RunListConfigs() { - if (!m_csolutionFile.empty()) { - // Parse all input files and create contexts - if (!PopulateContexts()) { - return false; - } + // Parse all input files and create contexts + if (!PopulateContexts()) { + return false; } // Parse context selection diff --git a/tools/projmgr/test/src/ProjMgrUnitTests.cpp b/tools/projmgr/test/src/ProjMgrUnitTests.cpp index 689aaec16..722dd90c5 100644 --- a/tools/projmgr/test/src/ProjMgrUnitTests.cpp +++ b/tools/projmgr/test/src/ProjMgrUnitTests.cpp @@ -4724,6 +4724,16 @@ info csolution: config files for each component:\n\ EXPECT_EQ(outStr, expected1); } +TEST_F(ProjMgrUnitTests, RunProjMgr_ListConfigsWithoutInput) { + StdStreamRedirect streamRedirect; + char* argv[3]; + argv[1] = (char*)"list"; + argv[2] = (char*)"configs"; + EXPECT_EQ(1, RunProjMgr(3, argv, m_envp)); + auto errStr = streamRedirect.GetErrorString(); + EXPECT_NE(string::npos, errStr.find("input yml files were not specified")); +} + TEST_F(ProjMgrUnitTests, RunProjMgr_No_target_Types) { StdStreamRedirect streamRedirect; char* argv[8];