mirror of
https://github.com/cirosantilli/linux-kernel-module-cheat.git
synced 2026-01-27 20:14:27 +01:00
getvar --type input, and improve docs for command line arguments
This commit is contained in:
7
getvar
7
getvar
@@ -29,6 +29,7 @@ List all available variables:
|
||||
....
|
||||
''',
|
||||
)
|
||||
self.add_argument('--type', choices=['input', 'all'], default='all')
|
||||
self.add_argument('variable', nargs='?')
|
||||
|
||||
def timed_main(self):
|
||||
@@ -36,7 +37,11 @@ List all available variables:
|
||||
if variable:
|
||||
print(self.env[variable])
|
||||
else:
|
||||
for key in self.env:
|
||||
if self.env['type'] == 'input':
|
||||
to_print = self.input_args
|
||||
elif self.env['type'] == 'all':
|
||||
to_print = self.env
|
||||
for key in sorted(to_print):
|
||||
print('{}={}'.format(key, self.env[key]))
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
||||
Reference in New Issue
Block a user