Support --help, --version and --changelog.

This commit is contained in:
Michał Górny 2010-07-12 10:32:18 +02:00
parent fd1dc7ae28
commit 4272f47b04

View File

@ -102,6 +102,20 @@ vcs_status() {
fi
}
print_help() {
cat <<_EOH_
Synopsis:
sunrise-commit [options] [--] <commit message>
Options:
-?, -h, --help print this message,
-V, --version print version string,
-c, --changelog backwards compat (ignored),
-v, --verbose enable verbose output.
_EOH_
}
# Guess what!
main() {
local commitmsg
@ -109,9 +123,22 @@ main() {
while [ ${#} -gt 0 ]; do
case "${1}" in
--help|-?|-h)
print_help
exit 0
;;
--version|-V)
echo 'sunrise-commit 1.0'
exit 0
;;
-c|--changelog)
# Now changelog entries are implicit -- backwards compat.
;;
-v|--verbose)
SC_VERBOSE=1
;;
--)
shift
commitmsg="${commitmsg+${commitmsg} }${@}"