Beispiel #1
0
License as published by the Free Software Foundation, either version
3 of the License, or (at your option) any later version.

XUTools is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
for more details.

You should have received a copy of the GNU General Public License
along with this program.  If not, see http://www.gnu.org/licenses/
"""

from xutools.tools import XUGrep
import optparse

import sys

p = optparse.OptionParser()
p.add_option("-o", "--R2", dest="r2")
(options, args) = p.parse_args()

if (len(args) < 2):
    print "Usage xugrep [--r2=LE] <xupath> <files>+"
    sys.exit(-1)

xpath = args[0]
file_paths = args[1:]

reports = XUGrep.xugrep_main(xpath, file_paths)
XUGrep.output_reports(reports, options.r2)