docs: public Command[] toArgs(final String line) {
          if (line == null || line.isEmpty()) {
              throw new IllegalArgumentException("Empty command.");
          }
  
          final List<Command> commands = new ArrayList<>();
          final List<String> result = new ArrayList<>();
          final StringBuilder current = new StringBuilder();
  
          char waitChar = ' ';
          boolean copyNextChar = false;
          boolean inEscaped = false;
          for (final char c : line.toCharArray()) {
              if (copyNextChar) {
                  current.append(c);
                  copyNextChar = false;
              } else if (waitChar == c) {
                  if (current.length() > 0) {
                      result.add(current.toString());
                      current.setLength(0);
                  }
                  waitChar = ' ';
                  inEscaped = false;
              } else {
                  switch (c) {
                      case '"':
                      case '\'':
                          if (!inEscaped) {
                              waitChar = c;
                              inEscaped = true;
                              break;
                          } else {
                              current.append(c);
                          }
                          break;
  
                      case '\\':
                          copyNextChar = true;
                          break;
  
                      case '|':
                          flush(commands, result, current);
                          break;
  
                      default:
                          current.append(c);
                  }
              }
          }
  
          if (waitChar != ' ') {
              throw new IllegalStateException("Missing closing " + Character.toString(waitChar));
          }
  
          flush(commands, result, current);
          return commands.toArray(new Command[commands.size()]);
      }