|
8 | 8 | import pathlib |
9 | 9 |
|
10 | 10 | from loam.manager import ConfOpt as Conf |
11 | | -from loam.tools import switch_opt, config_conf_section, set_conf_opt |
| 11 | +from loam import tools |
| 12 | +from loam.tools import switch_opt, command_flag |
12 | 13 |
|
13 | 14 |
|
14 | 15 | def _slice_or_int(arg): |
@@ -45,9 +46,8 @@ def parser(arg): |
45 | 46 | CONF_DEF = OrderedDict() |
46 | 47 |
|
47 | 48 | CONF_DEF['common'] = OrderedDict(( |
48 | | - ('config', Conf(None, True, None, {'action': 'store_true'}, |
49 | | - False, 'print config options')), |
50 | | - ('set', set_conf_opt()), |
| 49 | + ('config', command_flag(None, 'print config options')), |
| 50 | + ('set', tools.set_conf_opt()), |
51 | 51 | )) |
52 | 52 |
|
53 | 53 | CONF_DEF['core'] = OrderedDict(( |
@@ -215,16 +215,11 @@ def parser(arg): |
215 | 215 | )) |
216 | 216 |
|
217 | 217 | CONF_DEF['var'] = OrderedDict(( |
218 | | - ('field', Conf(None, True, None, {'action': 'store_true'}, |
219 | | - False, 'print field variables')), |
220 | | - ('sfield', Conf(None, True, None, {'action': 'store_true'}, |
221 | | - False, 'print surface field variables')), |
222 | | - ('rprof', Conf(None, True, None, {'action': 'store_true'}, |
223 | | - False, 'print rprof variables')), |
224 | | - ('time', Conf(None, True, None, {'action': 'store_true'}, |
225 | | - False, 'print time variables')), |
226 | | - ('refstate', Conf(None, True, None, {'action': 'store_true'}, |
227 | | - False, 'print refstate variables')), |
| 218 | + ('field', command_flag(None, 'print field variables')), |
| 219 | + ('sfield', command_flag(None, 'print surface field variables')), |
| 220 | + ('rprof', command_flag(None, 'print rprof variables')), |
| 221 | + ('time', command_flag(None, 'print time variables')), |
| 222 | + ('refstate', command_flag(None, 'print refstate variables')), |
228 | 223 | )) |
229 | 224 |
|
230 | | -CONF_DEF['config'] = config_conf_section() |
| 225 | +CONF_DEF['config'] = tools.config_conf_section() |
0 commit comments