/mxr

command-line interface for mxr.mozilla.org

Primary LanguageRuby

What is this about?!?
---------------------

bxr.rb - this is a cross reference designed to display the Mozilla source code
         in command line mode using a local database (sqlite3).
         This tool is meant to be used alone or with vim.

mxr.rb - a tool for having mxr.mozilla.org in command line mode.

Requirements
------------

*hpricot* (only for mxr.rb)
Url: https://github.com/hpricot/hpricot

  gem install hpricot
or
  apt-get install ruby-hpricot

*colored* (optional)
Url: https://github.com/defunkt/colored
gem install colored

*Sqlite3* (only for bxr.rb)
gem install sqlite3


How to install
--------------

  git clone git://github.com/bakulf/mxr.git
  cd mxr
  sudo make

I suggest to add this line in ~/.bashrc:

  alias bxr='bxr -c'
  alias mxr='mxr -c'

How to use bxr
--------------

Usage: bxr [options] <operation> <something>

Operations:
- create <path>
  Scan a path and create the index file .bxr.yml
- identifier <something>
  Type the full name of an identifier (a function name, variable name, typedef, etc.) to summarize.
- search <something>
  Search through the source code.
- file <something>
  Search for files (by name).

Options:
    -m, --max <something>            Set a max number of results shown.
    -l, --line <something>           Jump to this line.
    -t, --tool <tool>                The tool for showing the result. Default: less -FRSX
    -T, --no-tool                    No external tool is used for showing the result.
    -c, --color                      Enable the ASCII colors.
    -V, --vi                         VIm output.
    -h, --help                       Display this screen.

BSD license - Andrea Marchesini <baku@ippolita.net>

NOTE: .bxr.yml contains the path of the database file. The default is `.bxr.db'.

How to use bxr with vim
-----------------------

Copy bxr.vim into ~/.vim/plugin/

How to use mxr
--------------

Usage: mxr [options] <operation> <something>

Operations:
- identifier <something>
  Type the full name of an identifier (a function name, variable name, typedef, etc.) to summarize. Matches are case-sensitive.
- search <something>
  Free-text search through the source code, including comments.
- file <something>
  Search for files (by name) using regular expressions.
- browse <something>
  Show a file.

Without any operation, mxr starts in shell mode.

Options:
    -l, --line <something>           Jump to this line.
        --tree <something>           Set a tree (default: mozilla-central).
    -t, --tool <tool>                The tool for showing the result. Default: less -FRSX
    -T, --no-tool                    No external tool is used for showing the result.
    -p <local/path/for/the/repo>     The local path for the repository. This will be used to show the filenames.
        --path
    -c, --color                      Enable the ASCII colors.
    -h, --help                       Display this screen.

BSD license - Andrea Marchesini <baku@ippolita.net>