bro – みんなで評価し合うコマンドヘルプ
お役立ちコマンドが知りたければ使ってみましょう。 Linux/UNIXの操作で分からないことがあればとりあえずmanページを頼る人は多いでしょう。しかし長い間の文化によって徐々にmanページは使われなくなっているそうです。manページは変わらずありつつも、他のフォーマットの利用が進んでいるそうです。 確かに時代によってドキュメントフォーマットは変化していくべきでしょう。そこで今回はmanページに代わるbroを紹介します。
broのインストールはRubygemsで行います。
$ gem install bropages
これで準備完了です。使い方はmanコマンドと同じくbroコマンドの後ろに調べたいコマンドを書きます。例えばcurlの場合はこのようになります。
$ bro curl
9 entries for curl -- submit your own example with "bro add curl"
# get the contents of a web page
curl http://bropages.org
bro thanks to upvote (25)
bro ...no to downvote (2)
..................................................................................................
# download a file and write it to another file called myfile.html
curl -o myfile.html http://bropages.org
bro thanks 2 to upvote (14)
bro ...no 2 to downvote (0)
..................................................................................................
# Download a file using its original filename, follow all redirects, and continue where you left
off if the download previously failed
curl -LOC - http://foo.bar/file.ext
bro thanks 3 to upvote (12)
bro ...no 3 to downvote (0)
面白いのはサンプルコマンドの後ろにあるbro thanks
という説明です。これはその説明が役立った、役立っていないかによって評価をする仕組みになります。実際に役立ったかどうかで評価するというのは実用的で面白いですね。
broのコマンドオプションは次のようになっています。
$ bro help
NAME:
["bro"]
DESCRIPTION:
["Highly readable supplement to man pages.\n\nShows simple, concise examples for commands."]
COMMANDS:
...no Downvote an entry, bro
add Add an entry, bro
help Display global or [command] help documentation.
lookup Lookup an entry, bro. Or just call bro [COMMAND]
no Downvote an entry, bro
thanks Upvote an entry, bro
GLOBAL OPTIONS:
-h, --help
Display help documentation
-v, --version
Display version information
-t, --trace
Display backtrace when an error occurs
broの特徴としては使う人が評価するという仕組みではないでしょうか。コマンドはターミナルからしか実装できないようで、より開発者向けな仕組みになっています。 broはRuby製のオープンソース・ソフトウェア(BSD 2-Clause License)です。 bro: just get to the point! hubsmoke/bro