Permalink
Browse files

Added `bm view [query]` support

  • Loading branch information...
1 parent 131e6a3 commit 0e8b33315f887e91378fbfb0381f3bff69afff48 @tj committed Mar 16, 2012
Showing with 8 additions and 4 deletions.
  1. +2 −1 Readme.md
  2. +6 −3 bin/bm
View
@@ -49,6 +49,7 @@ Commands:
$ bm
# view bookmark screenshots in your default browser
+ $ vm view design
$ vm view
# clear all bookmarks
@@ -64,7 +65,7 @@ Options:
<a name="screenshots" />
## Screenshots
- Run `bm view` to view the bookmark screenshots in your default browser. This requires `webkit2png(1)` (`brew install webkit2png`).
+ Run `bm view [query]` to view the bookmark screenshots in your default browser. This requires `webkit2png(1)` (`brew install webkit2png`).
![bookmark screenshots](http://f.cl.ly/items/2Z3M2c033B031E3R071t/Screen%20Shot%202012-03-15%20at%207.55.57%20PM.png)
View
@@ -43,6 +43,7 @@ usage() {
$ bm
# view bookmark screenshots in your default browser
+ $ vm view design
$ vm view
# clear all bookmarks
@@ -156,7 +157,9 @@ EOF
#
urls() {
- cat $BOOKMARKS | cut -d '|' -f 1
+ cat $BOOKMARKS \
+ | grep "$1" \
+ | cut -d '|' -f 1
}
#
@@ -198,7 +201,7 @@ create_bookmark_screenshots() {
view_bookmark_screenshots() {
create_bookmark_screenshots
- local urls=`urls`
+ local urls=`urls "$1"`
style > /tmp/bm.html
@@ -243,7 +246,7 @@ while test $# -ne 0; do
search) search_bookmarks "$@"; exit ;;
open) open_bookmark "$@"; exit ;;
add) save_bookmark "$@"; exit ;;
- view) view_bookmark_screenshots; exit ;;
+ view) view_bookmark_screenshots "$@"; exit ;;
clear) clear_bookmarks; exit ;;
*) open_bookmark $arg; exit ;;
esac

0 comments on commit 0e8b333

Please sign in to comment.