title: Picocli: Best way to specify option with optional value that prints current value when no value specified
body: <p>I'm writing a REPL (so I'm using picocli internally to parse commands typed within the application, not to parse command line args), and I have a command with an option that I want to behave like this:</p>
  
  <pre><code>&gt; cmd --myopt
  Myopt value = 5
  &gt; cmd --myopt 4
  &gt; cmd --myopt
  Myopt value = 4
  </code></pre>
  
  <p>That is, if the option is specified with no value, the current value of the parameter is printed, but if it is specified with a value, then the value is set. I was thinking to do this like this:</p>
  
  <pre class="lang-java prettyprint-override"><code>int value = 1; // default
  @Option(names = {"-e", "--epsilon"}, arity = "0..1",
          description = "Acceptable values: [0, 1] default: ${DEFAULT-VALUE}")
  void setValue(String strValue) {
      if (strValue == "") {
          printValue();
      } else {
          try {
              value = Integer.parseInt(strValue);
              // validate value
          } catch (NumberFormatException e) {
              // print help for this option
          }
      }
  }
  </code></pre>
  
  <p>Is that the best way? Is there another way to capture the default value in the description while still allowing <code>setValue</code> to know that no value was specified?</p>
  
  <p><em>(See also <a href="https://github.com/remkop/picocli/issues/490" rel="nofollow noreferrer">https://github.com/remkop/picocli/issues/490</a> )</em></p>