aboutsummaryrefslogtreecommitdiff
path: root/src/wrappers/getopts.sh
diff options
context:
space:
mode:
authorroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-12-12 07:04:09 +0000
committerroktas <roktas@788f1e2b-df1e-0410-8736-df70ead52e1b>2006-12-12 07:04:09 +0000
commit426cbadfef6c26323faedcab2cd5ea7efa64d1bb (patch)
treee16afb28eec790226a7b0524b8fb325594232e5c /src/wrappers/getopts.sh
parent6411ea7466f67f94816c541a22abb7249d36c377 (diff)
downloadpandoc-426cbadfef6c26323faedcab2cd5ea7efa64d1bb.tar.gz
Merge changes in branches/wrappers into trunk.
[in trunk] svn merge -r105:HEAD \ https://pandoc.googlecode.com/svn/branches/wrappers git-svn-id: https://pandoc.googlecode.com/svn/trunk@177 788f1e2b-df1e-0410-8736-df70ead52e1b
Diffstat (limited to 'src/wrappers/getopts.sh')
-rw-r--r--src/wrappers/getopts.sh12
1 files changed, 12 insertions, 0 deletions
diff --git a/src/wrappers/getopts.sh b/src/wrappers/getopts.sh
new file mode 100644
index 000000000..263263c07
--- /dev/null
+++ b/src/wrappers/getopts.sh
@@ -0,0 +1,12 @@
+if [ -z "$SYNOPSIS" ]; then
+ SYNOPSIS="[-h] [input_file]"
+ [ -n "$THIS_NARG" ] || SYNOPSIS="${SYNOPSIS}..."
+fi
+
+while getopts h opt; do
+ case $opt in
+ h|?) usage "$SYNOPSIS"; exit 2 ;;
+ esac
+done
+
+shift $(($OPTIND - 1))