MCPcopy
hub / github.com/indigo-dc/udocker / parse

Method parse

udocker/cmdparser.py:29–48  ·  view source on GitHub ↗

Parse a command line string. Divides the string in three blocks: general_options, command name, and command options+arguments

(self, argv)

Source from the content-addressed store, hash-verified

27 self._argv_consumed_params['CMD_OPT'] = []
28
29 def parse(self, argv):
30 """Parse a command line string.
31 Divides the string in three blocks: general_options,
32 command name, and command options+arguments
33 """
34 step = 1
35 for arg in argv[1:]:
36 if not arg:
37 continue
38
39 if step == 1:
40 if arg[0] in string.ascii_letters:
41 self._argv_split['CMD'] = arg
42 step = 2
43 else:
44 self._argv_split['GEN_OPT'].append(arg)
45 elif step == 2:
46 self._argv_split['CMD_OPT'].append(arg)
47
48 return step == 2
49
50 def missing_options(self):
51 """Get command line options not used/fetched by Cmdp.get()

Callers 15

test_02__cdrepoMethod · 0.95
test_07_do_mkrepoMethod · 0.95
test_11_do_searchMethod · 0.95
test_12_do_loadMethod · 0.95
test_13_do_saveMethod · 0.95
test_14_do_importMethod · 0.95
test_15_do_exportMethod · 0.95
test_16_do_cloneMethod · 0.95
test_17_do_loginMethod · 0.95
test_18_do_logoutMethod · 0.95
test_19_do_pullMethod · 0.95
test_21_do_createMethod · 0.95

Calls 1

appendMethod · 0.80

Tested by 15

test_02__cdrepoMethod · 0.76
test_07_do_mkrepoMethod · 0.76
test_11_do_searchMethod · 0.76
test_12_do_loadMethod · 0.76
test_13_do_saveMethod · 0.76
test_14_do_importMethod · 0.76
test_15_do_exportMethod · 0.76
test_16_do_cloneMethod · 0.76
test_17_do_loginMethod · 0.76
test_18_do_logoutMethod · 0.76
test_19_do_pullMethod · 0.76
test_21_do_createMethod · 0.76