Created
February 8, 2015 13:53
-
-
Save willscripted/76af815da5a65f32729b to your computer and use it in GitHub Desktop.
playing around with getopts
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/usr/bin/env bash | |
| OPTIND=1 # Reset getopts iterator | |
| while getopts "ht:f:" opt; do | |
| case "$opt" in | |
| h|\?) | |
| echo "h or nothing?" | |
| exit 0 | |
| ;; | |
| t) to_format=$OPTARG | |
| echo "set the to param to $OPTARG" | |
| ;; | |
| f) from_format=$OPTARG | |
| echo "set the from param to $OPTARG" | |
| ;; | |
| esac | |
| done | |
| pandoc -t json -s < /dev/stdin | ./test.py | |
| echo "ok, byebye" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment