code: private <T extends Snippet> Stream<T> argsOptionsToSnippets(Supplier<Stream<T>> snippetSupplier,
              Predicate<Snippet> defFilter, String rawargs, String cmd) {
          ArgTokenizer at = new ArgTokenizer(cmd, rawargs.trim());
          at.allowedOptions("-all", "-start");
          List<String> args = new ArrayList<>();
          String s;
          while ((s = at.next()) != null) {
              args.add(s);
          }
          if (!checkOptionsAndRemainingInput(at)) {
              return null;
          }
          if (at.optionCount() > 0 && args.size() > 0) {
              errormsg("jshell.err.may.not.specify.options.and.snippets", at.whole());
              return null;
          }
          if (at.optionCount() > 1) {
              errormsg("jshell.err.conflicting.options", at.whole());
              return null;
          }
          if (at.hasOption("-all")) {
              // all snippets including start-up, failed, and overwritten
              return snippetSupplier.get();
          }
          if (at.hasOption("-start")) {
              // start-up snippets
              return snippetSupplier.get()
                      .filter(this::inStartUp);
          }
          if (args.isEmpty()) {
              // Default is all active user snippets
              return snippetSupplier.get()
                      .filter(defFilter);
          }
          return argsToSnippets(snippetSupplier, args);
      }
docs: Convert user arguments to a Stream of snippets referenced by those
  arguments (or lack of arguments).
  
  @param snippets the base list of possible snippets
  @param defFilter the filter to apply to the arguments if no argument
  @param rawargs the user's argument to the command, maybe be the empty
  string
  @return a Stream of referenced snippets or null if no matches are found