Is there a way to add an argument that is only usable as -p or -p=value, but not -p value
I want to add an optional argument --parallel/-p to the script. Here is how I want user to pass it:
./script arg1 arg2 -p # this defaults to 10
./script arg1 arg2 -p=13 # This is fine and will set the value to 13
./script arg1 arg2 -p 13 # This is NOT fine and I want to ban this. Next line will tell why.
./script -p arg1 arg2 # I want -p to be usable regardless of its position.
# But here arg1 will be considered as an argument of -p option, which is unwanted.