You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
## 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.
The text was updated successfully, but these errors were encountered:
Might I suggest flag instead of flags, since each line defines a flag and it will be repeated many times? Ex:
## purchase (price)> Calculate the total price of something.**OPTIONS*** flag: -t --tax |number| What's the tax?
* flag: ...
~~~sh
TAX=${tax:-1}# Fallback to 1 if not suppliedecho"Total: $(($price*$TAX))"~~~
Currently adding a flag is quite verbose:
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:
If no type is specified, the
|number|
part can be omitted.The text was updated successfully, but these errors were encountered: