aboutsummaryrefslogtreecommitdiffstats
path: root/libbe/cmdutil.py
diff options
context:
space:
mode:
authorW. Trevor King <wking@drexel.edu>2009-07-13 07:46:58 -0400
committerW. Trevor King <wking@drexel.edu>2009-07-13 07:46:58 -0400
commit17adbfb1c04684b986bf2c97cc4fa5197198aadc (patch)
treed588c5c801e142b59af53b9f9c15e3f9e1982737 /libbe/cmdutil.py
parent197fc012f26816c233b4844c82c32f2efc449fab (diff)
downloadbugseverywhere-17adbfb1c04684b986bf2c97cc4fa5197198aadc.tar.gz
Fixed "be --dir --complete"
Diffstat (limited to 'libbe/cmdutil.py')
-rw-r--r--libbe/cmdutil.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/libbe/cmdutil.py b/libbe/cmdutil.py
index a91b1c7..7589241 100644
--- a/libbe/cmdutil.py
+++ b/libbe/cmdutil.py
@@ -15,6 +15,7 @@
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+import glob
import optparse
import os
from textwrap import TextWrapper
@@ -187,6 +188,13 @@ def default_complete(options, args, parser, bugid_args={}):
raise GetCompletions(bugshortnames)
raise GetCompletions()
+def complete_path(path):
+ """List possible path completions for path."""
+ comps = glob.glob(path+"*") + glob.glob(path+"/*")
+ if len(comps) == 1 and os.path.isdir(comps[0]):
+ comps.extend(glob.glob(comps[0]+"/*"))
+ return comps
+
def underlined(instring):
"""Produces a version of a string that is underlined with '='