Permalink
Browse files

Add git-info -w option

  • Loading branch information...
1 parent 99c4fc0 commit 33c13c4ec23cf61d61611d202e2498af811a0f87 @lennartcl committed Oct 23, 2012
Showing with 17 additions and 2 deletions.
  1. +6 −1 README.md
  2. +11 −1 git-info
View
@@ -95,7 +95,12 @@ Maintains an open connection to speed up github access. See http://coderrr.wordp
### git-info
-Show information about the current repository.
+Show information about the current repository or a path within the repository.
+
+Usage: `git-info [-w] [PATH]`
+
+* `-w` Open a web page
+* `PATH` A path to show info for
License (MIT)
-------------
View
@@ -5,6 +5,11 @@
# License: MIT
# Copyright (c) 2012 Lennart C. L. Kats
+WEB=
+if [ "$1" == "-w" ]; then
+ WEB=-w
+ shift
+fi
if [ "$1" == "" ]; then
git remote -v
@@ -43,4 +48,9 @@ RELPATH=`echo "$FILE" | sed "s|$BASEPATH/||"`
git status $FILE
echo "# URL:"
-echo "https://github.com/$USER/$REPO/blob/$BRANCH/$RELPATH"
+URL="https://github.com/$USER/$REPO/blob/$BRANCH/$RELPATH"
+echo $URL
+
+if [ $WEB ]; then
+ open $URL
+fi

0 comments on commit 33c13c4

Please sign in to comment.