code: public ArgumentBuilder withFlag(final boolean addFlag, final String flag) {
  
          // Bail out?
          if (!addFlag) {
              return this;
          }
  
          // Check sanity
          Validate.notEmpty(flag, "flag");
          Validate.isTrue(!AbstractJaxbMojo.CONTAINS_WHITESPACE.matcher(flag).matches(),
                  "Flags cannot contain whitespace. Got: [" + flag + "]");
  
          // Trim, and add the flag as an argument.
          final String trimmed = flag.trim();
          Validate.notEmpty(trimmed, "flag");
  
          // Prepend the DASH if required
          final String toAdd = trimmed.charAt(0) != DASH ? DASH + trimmed : trimmed;
  
          // Assign the argument only if not already set.
          if (getIndexForFlag(toAdd) == NOT_FOUND) {
              synchronized (lock) {
                  arguments.add(toAdd);
              }
          }
  
          // All done.
          return this;
      }
docs: <p>Adds a flag on the form {@code -someflag} to the list of arguments contained within this ArgumentBuilder.
  If the {@code flag} argument does not start with a dash ('-'), one will be prepended.</p>
  <p>Typical usage:</p>
  <pre><code>
  argumentBuilder
  .withFlag(someBooleanParameter, "foobar")
  .withFlag(someOtherBooleanParameter, "gnat")
  .withFlag(someThirdBooleanParameter, "gnu")
  ....
  </code></pre>
  
  @param addFlag if {@code true}, the flag will be added to the underlying list of arguments
  within this ArgumentBuilder.
  @param flag    The flag/argument to add. The flag must be a complete word, implying it
  cannot contain whitespace.
  @return This ArgumentBuilder, for chaining.