-
Notifications
You must be signed in to change notification settings - Fork 58
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Currently adding a flag is quite verbose:
## purchase (price)
> Calculate the total price of something.
**OPTIONS**
* tax
* flags: -t --tax
* type: number
* desc: What's the tax?
~~~sh
TAX=${tax:-1} # Fallback to 1 if not supplied
echo "Total: $(($price * $TAX))"
~~~
We end needing to write out the flag name twice and use 4 lines.
I'd like to propose support for a shorter readable syntax:
## purchase (price)
> Calculate the total price of something.
**OPTIONS**
* flags: -t --tax |number| What's the tax?
~~~sh
TAX=${tax:-1} # Fallback to 1 if not supplied
echo "Total: $(($price * $TAX))"
~~~
If no type is specified, the |number|
part can be omitted.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request