code: public static SettingsRate get(Map<String, String[]> clArgs, SettingsCommand command)
      {
          String[] params = clArgs.remove("-rate");
          if (params == null)
          {
              switch (command.type)
              {
                  case WRITE:
                  case COUNTER_WRITE:
                      if (command.count > 0)
                      {
                          ThreadOptions options = new ThreadOptions();
                          options.accept("threads=200");
                          return new SettingsRate(options);
                      }
              }
              AutoOptions options = new AutoOptions();
              options.accept("auto");
              return new SettingsRate(options);
          }
          GroupedOptions options = GroupedOptions.select(params, new AutoOptions(), new ThreadOptions());
          if (options == null)
          {
              printHelp();
              System.out.println("Invalid -rate options provided, see output for valid options");
              System.exit(1);
          }
          if (options instanceof AutoOptions)
              return new SettingsRate((AutoOptions) options);
          else if (options instanceof ThreadOptions)
              return new SettingsRate((ThreadOptions) options);
          else
              throw new IllegalStateException();
      }
docs: CLI Utility Methods