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 if len(sys.argv) == 1 or sys.argv[1] in ('--help', '-h'):
30 elif sys.argv[1] == '--complete':
31 for command, module in cmdutil.iter_commands():
33 print '\n'.join(["--help","--complete","--options","--version"])
34 elif sys.argv[1] == '--version':
35 print _version.version_info["revision_id"]
38 sys.exit(cmdutil.execute(sys.argv[1], sys.argv[2:]))
39 except cmdutil.GetHelp:
40 print cmdutil.help(sys.argv[1])
42 except cmdutil.GetCompletions, e:
43 print '\n'.join(e.completions)
45 except cmdutil.UnknownCommand, e:
48 except cmdutil.UsageError, e:
49 print "Invalid usage:", e
50 print "\nArgs:", sys.argv[1:]
51 print cmdutil.help(sys.argv[1])
53 except cmdutil.UserError, e: