2 # Copyright (C) 2005-2009 Aaron Bentley and Panometrics, Inc.
3 # Chris Ball <cjb@laptop.org>
4 # Oleg Romanyshyn <oromanyshyn@panoramicfeedback.com>
5 # W. Trevor King <wking@drexel.edu>
6 # <abentley@panoramicfeedback.com>
8 # This program is free software; you can redistribute it and/or modify
9 # it under the terms of the GNU General Public License as published by
10 # the Free Software Foundation; either version 2 of the License, or
11 # (at your option) any later version.
13 # This program is distributed in the hope that it will be useful,
14 # but WITHOUT ANY WARRANTY; without even the implied warranty of
15 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16 # GNU General Public License for more details.
18 # You should have received a copy of the GNU General Public License
19 # along with this program; if not, write to the Free Software
20 # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 from libbe import cmdutil, _version
26 __doc__ = cmdutil.help()
28 usage = "be [options] [command] [command_options ...] [command_args ...]"
30 parser = cmdutil.CmdOptionParser(usage)
32 parser.add_option("--version", action="store_true", dest="version",
33 help="Print version string and exit")
36 options,args = parser.parse_args()
37 except cmdutil.GetHelp:
38 print cmdutil.help(parser=parser)
40 except cmdutil.GetCompletions, e:
41 print '\n'.join(e.completions)
44 if options.version == True:
45 print _version.version_info["revision_id"]
50 raise cmdutil.UsageError, "must supply a command"
51 sys.exit(cmdutil.execute(args[0], args[1:]))
52 except cmdutil.GetHelp:
53 print cmdutil.help(sys.argv[1])
55 except cmdutil.GetCompletions, e:
56 print '\n'.join(e.completions)
58 except cmdutil.UnknownCommand, e:
61 except cmdutil.UsageError, e:
62 print "Invalid usage:", e
64 print cmdutil.help(parser=parser)
67 print cmdutil.help(sys.argv[1])
69 except cmdutil.UserError, e: