[llvm] [CommandLine] Better report unknown subcommands (PR #74811)
    Igor Kudrin via llvm-commits 
    llvm-commits at lists.llvm.org
       
    Tue Dec 12 22:03:22 PST 2023
    
    
  
================
@@ -2206,4 +2206,25 @@ TEST(CommandLineTest, DefaultValue) {
   EXPECT_EQ(1, StrInitOption.getNumOccurrences());
 }
 
+TEST(CommandLineTest, UnknownSubcommand) {
+  cl::ResetCommandLineParser();
+
+  StackSubCommand SC1("foo", "Foo subcommand");
+  StackSubCommand SC2("bar", "Bar subcommand");
+  StackOption<bool> SC1Opt("f", cl::sub(SC1));
+  StackOption<bool> SC2Opt("b", cl::sub(SC2));
+  StackOption<bool> TopOpt("t");
----------------
igorkudrin wrote:
Thanks. Done
https://github.com/llvm/llvm-project/pull/74811
    
    
More information about the llvm-commits
mailing list