##// END OF EJS Templates
alias: change return code of bad definition to 255...
Yuya Nishihara -
r21572:6c9b7712 stable
parent child Browse files
Show More
@@ -355,7 +355,7 b' class cmdalias(object):'
355 if not self.definition:
355 if not self.definition:
356 def fn(ui, *args):
356 def fn(ui, *args):
357 ui.warn(_("no definition for alias '%s'\n") % self.name)
357 ui.warn(_("no definition for alias '%s'\n") % self.name)
358 return 1
358 return -1
359 self.fn = fn
359 self.fn = fn
360 self.badalias = True
360 self.badalias = True
361 return
361 return
@@ -389,7 +389,7 b' class cmdalias(object):'
389 def fn(ui, *args):
389 def fn(ui, *args):
390 ui.warn(_("error in definition for alias '%s': %s\n")
390 ui.warn(_("error in definition for alias '%s': %s\n")
391 % (self.name, inst))
391 % (self.name, inst))
392 return 1
392 return -1
393 self.fn = fn
393 self.fn = fn
394 self.badalias = True
394 self.badalias = True
395 return
395 return
@@ -402,7 +402,7 b' class cmdalias(object):'
402 ui.warn(_("error in definition for alias '%s': %s may only "
402 ui.warn(_("error in definition for alias '%s': %s may only "
403 "be given on the command line\n")
403 "be given on the command line\n")
404 % (self.name, invalidarg))
404 % (self.name, invalidarg))
405 return 1
405 return -1
406
406
407 self.fn = fn
407 self.fn = fn
408 self.badalias = True
408 self.badalias = True
@@ -434,14 +434,14 b' class cmdalias(object):'
434 commands.help_(ui, cmd, unknowncmd=True)
434 commands.help_(ui, cmd, unknowncmd=True)
435 except error.UnknownCommand:
435 except error.UnknownCommand:
436 pass
436 pass
437 return 1
437 return -1
438 self.fn = fn
438 self.fn = fn
439 self.badalias = True
439 self.badalias = True
440 except error.AmbiguousCommand:
440 except error.AmbiguousCommand:
441 def fn(ui, *args):
441 def fn(ui, *args):
442 ui.warn(_("alias '%s' resolves to ambiguous command '%s'\n") \
442 ui.warn(_("alias '%s' resolves to ambiguous command '%s'\n") \
443 % (self.name, cmd))
443 % (self.name, cmd))
444 return 1
444 return -1
445 self.fn = fn
445 self.fn = fn
446 self.badalias = True
446 self.badalias = True
447
447
@@ -61,7 +61,7 b' unknown'
61
61
62 $ hg unknown
62 $ hg unknown
63 alias 'unknown' resolves to unknown command 'bargle'
63 alias 'unknown' resolves to unknown command 'bargle'
64 [1]
64 [255]
65 $ hg help unknown
65 $ hg help unknown
66 alias 'unknown' resolves to unknown command 'bargle'
66 alias 'unknown' resolves to unknown command 'bargle'
67
67
@@ -70,7 +70,7 b' ambiguous'
70
70
71 $ hg ambiguous
71 $ hg ambiguous
72 alias 'ambiguous' resolves to ambiguous command 's'
72 alias 'ambiguous' resolves to ambiguous command 's'
73 [1]
73 [255]
74 $ hg help ambiguous
74 $ hg help ambiguous
75 alias 'ambiguous' resolves to ambiguous command 's'
75 alias 'ambiguous' resolves to ambiguous command 's'
76
76
@@ -79,7 +79,7 b' recursive'
79
79
80 $ hg recursive
80 $ hg recursive
81 alias 'recursive' resolves to unknown command 'recursive'
81 alias 'recursive' resolves to unknown command 'recursive'
82 [1]
82 [255]
83 $ hg help recursive
83 $ hg help recursive
84 alias 'recursive' resolves to unknown command 'recursive'
84 alias 'recursive' resolves to unknown command 'recursive'
85
85
@@ -88,7 +88,7 b' no definition'
88
88
89 $ hg nodef
89 $ hg nodef
90 no definition for alias 'nodefinition'
90 no definition for alias 'nodefinition'
91 [1]
91 [255]
92 $ hg help nodef
92 $ hg help nodef
93 no definition for alias 'nodefinition'
93 no definition for alias 'nodefinition'
94
94
@@ -97,7 +97,7 b' no closing quotation'
97
97
98 $ hg noclosing
98 $ hg noclosing
99 error in definition for alias 'noclosingquotation': No closing quotation
99 error in definition for alias 'noclosingquotation': No closing quotation
100 [1]
100 [255]
101 $ hg help noclosing
101 $ hg help noclosing
102 error in definition for alias 'noclosingquotation': No closing quotation
102 error in definition for alias 'noclosingquotation': No closing quotation
103
103
@@ -106,27 +106,27 b' invalid options'
106
106
107 $ hg no--cwd
107 $ hg no--cwd
108 error in definition for alias 'no--cwd': --cwd may only be given on the command line
108 error in definition for alias 'no--cwd': --cwd may only be given on the command line
109 [1]
109 [255]
110 $ hg help no--cwd
110 $ hg help no--cwd
111 error in definition for alias 'no--cwd': --cwd may only be given on the command line
111 error in definition for alias 'no--cwd': --cwd may only be given on the command line
112 $ hg no-R
112 $ hg no-R
113 error in definition for alias 'no-R': -R may only be given on the command line
113 error in definition for alias 'no-R': -R may only be given on the command line
114 [1]
114 [255]
115 $ hg help no-R
115 $ hg help no-R
116 error in definition for alias 'no-R': -R may only be given on the command line
116 error in definition for alias 'no-R': -R may only be given on the command line
117 $ hg no--repo
117 $ hg no--repo
118 error in definition for alias 'no--repo': --repo may only be given on the command line
118 error in definition for alias 'no--repo': --repo may only be given on the command line
119 [1]
119 [255]
120 $ hg help no--repo
120 $ hg help no--repo
121 error in definition for alias 'no--repo': --repo may only be given on the command line
121 error in definition for alias 'no--repo': --repo may only be given on the command line
122 $ hg no--repository
122 $ hg no--repository
123 error in definition for alias 'no--repository': --repository may only be given on the command line
123 error in definition for alias 'no--repository': --repository may only be given on the command line
124 [1]
124 [255]
125 $ hg help no--repository
125 $ hg help no--repository
126 error in definition for alias 'no--repository': --repository may only be given on the command line
126 error in definition for alias 'no--repository': --repository may only be given on the command line
127 $ hg no--config
127 $ hg no--config
128 error in definition for alias 'no--config': --config may only be given on the command line
128 error in definition for alias 'no--config': --config may only be given on the command line
129 [1]
129 [255]
130
130
131 optional repository
131 optional repository
132
132
General Comments 0
You need to be logged in to leave comments. Login now