##// END OF EJS Templates
alias: handle shlex error in command aliases...
Yuya Nishihara -
r21569:c5afb07c stable
parent child Browse files
Show More
@@ -383,7 +383,16 b' class cmdalias(object):'
383 self.fn = fn
383 self.fn = fn
384 return
384 return
385
385
386 args = shlex.split(self.definition)
386 try:
387 args = shlex.split(self.definition)
388 except ValueError, inst:
389 def fn(ui, *args):
390 ui.warn(_("error in definition for alias '%s': %s\n")
391 % (self.name, inst))
392 return 1
393 self.fn = fn
394 self.badalias = True
395 return
387 self.cmdname = cmd = args.pop(0)
396 self.cmdname = cmd = args.pop(0)
388 args = map(util.expandpath, args)
397 args = map(util.expandpath, args)
389
398
@@ -11,6 +11,7 b''
11 > ambiguous = s
11 > ambiguous = s
12 > recursive = recursive
12 > recursive = recursive
13 > nodefinition =
13 > nodefinition =
14 > noclosingquotation = '
14 > no--cwd = status --cwd elsewhere
15 > no--cwd = status --cwd elsewhere
15 > no-R = status -R elsewhere
16 > no-R = status -R elsewhere
16 > no--repo = status --repo elsewhere
17 > no--repo = status --repo elsewhere
@@ -92,6 +93,15 b' no definition'
92 no definition for alias 'nodefinition'
93 no definition for alias 'nodefinition'
93
94
94
95
96 no closing quotation
97
98 $ hg noclosing
99 error in definition for alias 'noclosingquotation': No closing quotation
100 [1]
101 $ hg help noclosing
102 error in definition for alias 'noclosingquotation': No closing quotation
103
104
95 invalid options
105 invalid options
96
106
97 $ hg no--cwd
107 $ hg no--cwd
General Comments 0
You need to be logged in to leave comments. Login now