These are chat archives for kbknapp/clap-rs

14th
Mar 2018
Chris McDonald
@cjm00
Mar 14 2018 16:30
Is it possible to set up an argument that takes a value that if not present has a default, and if present without a value specified has a different default?
  - TERMINATOR:
      help: Specifies the single-byte pattern to separate entries by. Default is newline.
      short: z
      long: terminator
      default_value_if:
          - [TERMINATOR, Null, "\\0"]
      default_value: "\\n"
I have this currently but this always yields "\n", even if passed with just -z