Replies: 1 comment 6 replies
-
First off, I would say that CLI pattern you are trying to create is a bit of an oddball and I would recommend seriously reconsidering if it is the right design. That said, you could mark the arguments with |
Beta Was this translation helpful? Give feedback.
6 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hello, I want to use clap to define two parameters, such as -a parameter and -b parameter. These two parameters can be used at the same time or separately. For example, used at the same time: -a -b test.txt;
Use alone: -a test.txt; -b test.txt
The problem I am currently encountering is that when the -a parameter and the -b parameter are used at the same time, both parameters must have a value. But I hope that when these two parameters are used at the same time, I only need the -b parameter to have a value.
![image](https://private-user-images.githubusercontent.com/92200077/277583292-370e260a-550e-4c5c-b779-60d043ec00b4.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MTkwMzg4MzMsIm5iZiI6MTcxOTAzODUzMywicGF0aCI6Ii85MjIwMDA3Ny8yNzc1ODMyOTItMzcwZTI2MGEtNTUwZS00YzVjLWI3NzktNjBkMDQzZWMwMGI0LnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA2MjIlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNjIyVDA2NDIxM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPWE0N2Q4ZDk1MTYzNzA3MWQyYTY1YzcyOWFhMDdlNjU4ZWFlMzQwMDIxNjNiMjA3NDc2OTNlMTgwMDBiNzUzYWImWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.Y1irUtrVbCspF0LstUKlwayk74-pc8V18GZQqUzLrEM)
Beta Was this translation helpful? Give feedback.
All reactions