Revision e3ac208c scripts/gnt-os
b/scripts/gnt-os | ||
---|---|---|
41 | 41 |
@return: the desired exit code |
42 | 42 |
|
43 | 43 |
""" |
44 |
op = opcodes.OpDiagnoseOS(output_fields=["name", "valid"], names=[]) |
|
44 |
op = opcodes.OpDiagnoseOS(output_fields=["name", "valid", "variants"], |
|
45 |
names=[]) |
|
45 | 46 |
result = SubmitOpCode(op) |
46 | 47 |
|
47 | 48 |
if not result: |
... | ... | |
53 | 54 |
else: |
54 | 55 |
headers = None |
55 | 56 |
|
57 |
os_names = [] |
|
58 |
for (name, valid, variants) in result: |
|
59 |
if valid: |
|
60 |
os_names.extend([[n] for n in CalculateOSNames(name, variants)]) |
|
61 |
|
|
56 | 62 |
data = GenerateTable(separator=None, headers=headers, fields=["name"], |
57 |
data=[[row[0]] for row in result if row[1]], |
|
58 |
units=None) |
|
63 |
data=os_names, units=None) |
|
59 | 64 |
|
60 | 65 |
for line in data: |
61 | 66 |
ToStdout(line) |
Also available in: Unified diff