Support --help, --version and --changelog.
This commit is contained in:
parent
fd1dc7ae28
commit
4272f47b04
@ -102,6 +102,20 @@ vcs_status() {
|
|||||||
fi
|
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!
|
# Guess what!
|
||||||
main() {
|
main() {
|
||||||
local commitmsg
|
local commitmsg
|
||||||
@ -109,9 +123,22 @@ main() {
|
|||||||
|
|
||||||
while [ ${#} -gt 0 ]; do
|
while [ ${#} -gt 0 ]; do
|
||||||
case "${1}" in
|
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)
|
-v|--verbose)
|
||||||
SC_VERBOSE=1
|
SC_VERBOSE=1
|
||||||
;;
|
;;
|
||||||
|
|
||||||
--)
|
--)
|
||||||
shift
|
shift
|
||||||
commitmsg="${commitmsg+${commitmsg} }${@}"
|
commitmsg="${commitmsg+${commitmsg} }${@}"
|
||||||
|
Loading…
Reference in New Issue
Block a user