comparison mercurial/fancyopts.py @ 209:63af1db35611

Beginning of new command parsing interface -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 Beginning of new command parsing interface This adds commands.py, with a primary interface dispatch(args) Dispatch searches a table of known commands, handles switches, sets up a repo object if appropriate, and dispatches the command. It also handles KeyboardInterrupt and can handle similar exceptions in the future. If the command is unknown, it falls through to the current command handler. Commands currently handled by the new scheme: help, init, and annotate manifest hash: 134cd032c880985e3f92f82efb8b629dd862ba4c -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.0 (GNU/Linux) iD8DBQFCnXEGywK+sNU5EO8RAuDAAJ9q7K4w7qGVWv1NWjCPFGO/UJc6VQCdEhMQ sBBlSRzah9QPy8K94catZyg= =wuRf -----END PGP SIGNATURE-----
author mpm@selenic.com
date Wed, 01 Jun 2005 00:25:42 -0800
parents 2e87f04880ab
children 11d64332a1cb
comparison
equal deleted inserted replaced
208:0a37e9c8ad6c 209:63af1db35611
44 if dt[map[opt]] is type(help): state[map[opt]](state,map[opt],arg) 44 if dt[map[opt]] is type(help): state[map[opt]](state,map[opt],arg)
45 elif dt[map[opt]] is type(1): state[map[opt]] = int(arg) 45 elif dt[map[opt]] is type(1): state[map[opt]] = int(arg)
46 elif dt[map[opt]] is type(''): state[map[opt]] = arg 46 elif dt[map[opt]] is type(''): state[map[opt]] = arg
47 elif dt[map[opt]] is type([]): state[map[opt]].append(arg) 47 elif dt[map[opt]] is type([]): state[map[opt]].append(arg)
48 elif dt[map[opt]] is type(None): state[map[opt]] = 1 48 elif dt[map[opt]] is type(None): state[map[opt]] = 1
49 49
50 del state["help"]
51
50 return args 52 return args
51 53