q is for query
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


#q is for query

…and don’t you forget it!

##how do I get it?

gem install qtool

##what is it?

q is a small tool for performing repetitive tasks from the console. Where you use rake to automate a project’s tasks, you’d use q to automate your own workflow a little. q commands are relatively free-form, with a few built-in ones that I use frequently enough.

##how do I use it?

  1. Searching via Google:

     q search search terms

    Searches for the passed-in terms on Google. Synonyms are google, g. This is also the default, so if you enter q foo bar it will google for “foo bar” (assuming you haven’t got a command with the shortcut “foo” installed).

  2. Looking up Wikipedia articles:

     q wikipedia toast

    Looks up the named article on Wikipedia. A synonym is wp.

  3. Looking up Ruby core class docs:

     q ruby Hash

    Looks up the docs for Hash on ruby-doc.org. A synonym is rb.

  4. Looking up Cocoa/related documentation:

     q ns Array

    Looks up the docs for NSArray in the on-disk filesystem (uses globbing to find them); therefore it doesn’t require an internet connection and finishes very quickly. Synonyms are: ca, cf, cg, dom, eagl, gl, glu, ib, qt, ui, web.

##how do I add my own commands?

commence vague hand-waving Write a subclass of Q::Command! And, um, let q know about it in some mysterious way that I haven’t figured out yet. Suggestions are welcome.