code: public static SettingsMode get(Map<String, String[]> clArgs)
      {
          String[] params = clArgs.remove("-mode");
          if (params == null)
          {
              Cql3NativeOptions opts = new Cql3NativeOptions();
              opts.accept("cql3");
              opts.accept("native");
              opts.accept("prepared");
              return new SettingsMode(opts);
          }
  
          GroupedOptions options = GroupedOptions.select(params, new ThriftOptions(), new Cql3NativeOptions(), new Cql3ThriftOptions(), new Cql3SimpleNativeOptions(), new Cql2ThriftOptions());
          if (options == null)
          {
              printHelp();
              System.out.println("Invalid -mode options provided, see output for valid options");
              System.exit(1);
          }
          return new SettingsMode(options);
      }
docs: CLI Utility Methods