Show More
@@ -263,21 +263,15 b' def earlygetopt(aliases, args):' | |||
|
263 | 263 | while pos < argcount: |
|
264 | 264 | valuepos = argcount |
|
265 | 265 | for opt in aliases: |
|
266 |
# short option can have no space |
|
|
266 | # short option can have no following space, e.g. hg log -Rfoo: | |
|
267 | 267 | if len(opt) == 2: |
|
268 | 268 | i = argcount |
|
269 | 269 | while i > 0: |
|
270 | 270 | i -= 1 |
|
271 | 271 | arg = args[i] |
|
272 |
if len(arg) > 2 and arg |
|
|
273 |
|
|
|
274 | # split Rfoo -> R foo | |
|
275 | if 0 < optpos < len(arg)-1: | |
|
276 | args[i:i+1] = [arg[:optpos+1], arg[optpos+1:]] | |
|
277 | argcount += 1 | |
|
278 | # split -qR -> -q -R | |
|
279 | if optpos > 1: | |
|
280 | args[i:i+1] = [arg[:optpos], opt] | |
|
272 | if len(arg) > 2 and arg.startswith(opt): | |
|
273 | # split -Rfoo -> -R foo | |
|
274 | args[i:i+1] = [opt, arg[2:]] | |
|
281 | 275 |
|
|
282 | 276 | # find next occurance of current alias |
|
283 | 277 | try: |
@@ -32,10 +32,8 b' echo "%% earlygetopt with duplicate opti' | |||
|
32 | 32 | hg --cwd a --cwd b --cwd c tip |
|
33 | 33 | hg --repo c --repository b -R a tip |
|
34 | 34 | |
|
35 |
echo "%% earlygetopt short option without space |
|
|
36 | hg -qR a tip | |
|
35 | echo "%% earlygetopt short option without following space" | |
|
37 | 36 | hg -q -Rb tip |
|
38 | hg -qRc tip | |
|
39 | 37 | |
|
40 | 38 | echo %% --cwd |
|
41 | 39 | hg --cwd a parents |
@@ -46,10 +46,8 b' user: test' | |||
|
46 | 46 | date: Thu Jan 01 00:00:01 1970 +0000 |
|
47 | 47 | summary: a |
|
48 | 48 | |
|
49 |
%% earlygetopt short option without space |
|
|
50 | 0:8580ff50825a | |
|
49 | %% earlygetopt short option without following space | |
|
51 | 50 | 0:b6c483daf290 |
|
52 | 1:b6c483daf290 | |
|
53 | 51 | %% --cwd |
|
54 | 52 | changeset: 0:8580ff50825a |
|
55 | 53 | tag: tip |
General Comments 0
You need to be logged in to leave comments.
Login now