deno-cliffy icon indicating copy to clipboard operation
deno-cliffy copied to clipboard

Add a way to make options conflicting with arguments

Open lowlighter opened this issue 3 years ago • 2 comments

As discussed in #225, it could be nice to make it possible to create conflicting depending on passed arguments

One use case could be when you want the default argument be a file, but alternative sources could be passed as option

mycli read-stuff my_file_with_content.json
mycli read-stuff --from-port 443
.command("read-stuff [file]")
.option("--form-port <port>", {conflicts:"[file]"})

lowlighter avatar Jun 29 '21 21:06 lowlighter

Currently thinking about this. Maybe it's better to add a .argument(name, options) method so you can define conflicting options on the argument instead of defining conflicting arguments on the option.

c4spar avatar Feb 26 '23 00:02 c4spar