Skip to content

Instantly share code, notes, and snippets.

@thenigan
Created May 6, 2010 20:38
Show Gist options
  • Save thenigan/392676 to your computer and use it in GitHub Desktop.
Save thenigan/392676 to your computer and use it in GitHub Desktop.
#!/bin/sh -e
# Copyright 2010, Tim Henigan <tim.henigan@gmail.com>
#
# A simple launcher for gitk which will print usage instructions
# if requested
for i in $*
do
case "$i" in
-h|--h|--he|--hel|--help)
echo "$0 [<option>...] [<revs>] [--] [<path>...]"
exit 0
esac
done
gitk "$@"
exit $?
@thenigan
Copy link
Author

thenigan commented May 7, 2010

I'm not sure if this would be a worthwhile addition. Right now, you cannot type gitk --help at the command line to get usage instructions. This is due to the fact that wish does not allow printing to STDOUT.

It is possible to use man gitk or git help gitk, but the lack of gitk --help can be confusing.

To work around this, a launcher script can be used to look for --help on the command line. If it is present, then print usage instructions and exit. If it is not, then call gitk.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment