1 # Copyright (C) 2005-2009 Aaron Bentley and Panometrics, Inc.
2 # Marien Zwart <marienz@gentoo.org>
3 # Thomas Gerigk <tgerigk@gmx.de>
4 # W. Trevor King <wking@drexel.edu>
6 # This program is free software; you can redistribute it and/or modify
7 # it under the terms of the GNU General Public License as published by
8 # the Free Software Foundation; either version 2 of the License, or
9 # (at your option) any later version.
11 # This program is distributed in the hope that it will be useful,
12 # but WITHOUT ANY WARRANTY; without even the implied warranty of
13 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 # GNU General Public License for more details.
16 # You should have received a copy of the GNU General Public License along
17 # with this program; if not, write to the Free Software Foundation, Inc.,
18 # 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
20 from libbe import cmdutil, bugdir
23 def execute(args, manipulate_encodings=True):
26 >>> bd = bugdir.SimpleBugDir()
28 >>> print bd.bug_from_shortname("b").status
30 >>> execute(["b"], manipulate_encodings=False)
32 >>> print bd.bug_from_shortname("b").status
37 options, args = parser.parse_args(args)
38 cmdutil.default_complete(options, args, parser,
39 bugid_args={0: lambda bug : bug.active==False})
41 raise cmdutil.UsageError, "Please specify a bug id."
43 raise cmdutil.UsageError, "Too many arguments."
44 bd = bugdir.BugDir(from_disk=True,
45 manipulate_encodings=manipulate_encodings)
46 bug = cmdutil.bug_from_shortname(bd, args[0])
50 parser = cmdutil.CmdOptionParser("be open BUG-ID")
58 return get_parser().help_str() + longhelp