Skip to content

Commit

Permalink
Document git-dirs
Browse files Browse the repository at this point in the history
  • Loading branch information
lilyball committed Dec 23, 2014
1 parent b8bdd1d commit 12fb79b
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
5 changes: 5 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,8 @@ the remote branch deleted. See `git close-current-branch --help` for details.
Closes all local branches that have been merged into HEAD (or a specified
branch). This command is upstream-aware, and can be instructed to close remote
branches as well. See `git close-merged --help` for details.

## `git-dirs`

Prints a list of the most recently checked-out branches. See `git dirs --help`
for details.
18 changes: 12 additions & 6 deletions git-dirs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,17 @@ source "${BASH_SOURCE[0]%/*}"/utils.bash
# So we need to repeatedly invoke it for each branch.

usage() {
echo "git dirs [(-l|--limit) N]"
echo ""
echo " --limit|-l N"
echo " Limits the branch history to N previous branches"
echo " (default 10)"
echo "Usage: git dirs [(--limit N)]"
echo
echo "Options:"
echo " -h --help Displays this help."
echo " -l N, --limit N Limits the branch history to N previous branches."
echo " [default: 10]"
[[ -z $1 ]] && return
echo
echo "Description:"
echo " Prints the N most recently checked-out branches."
echo " Branches that have been deleted are displayed as '(deleted branch)'."
}

limit=10
Expand All @@ -25,7 +31,7 @@ while (( $# > 0 )); do
shift
;;
--help|-h)
usage
usage full
exit 0
;;
--)
Expand Down

0 comments on commit 12fb79b

Please sign in to comment.