~abentley/bzrtools/bzrtools.dev

« back to all changes in this revision

Viewing changes to shell.py

  • Committer: Aaron Bentley
  • Date: 2006-06-23 18:26:33 UTC
  • Revision ID: abentley@panoramicfeedback.com-20060623182633-f4df25cd7ec93a29
Handle quoted strings without bailing to a subshell

Show diffs side-by-side

added added

removed removed

Lines of Context:
19
19
from itertools import chain
20
20
import os
21
21
import readline
 
22
import shlex
22
23
import string
23
24
import sys
24
25
 
159
160
        self.default("help "+line)
160
161
 
161
162
    def default(self, line):
162
 
        args = line.split()
 
163
        args = shlex.split(line)
163
164
        alias_args = get_alias(args[0])
164
165
        if alias_args is not None:
165
166
            args[0] = alias_args.pop(0)
292
293
 
293
294
 
294
295
def too_complicated(line):
295
 
    for char in '|<>"\"*?':
 
296
    for char in '|<>*?':
296
297
        if char in line:
297
298
            return True
298
299
    return False