help: Minor refactoring in get-logs action

- Make command line arguments more readable.

- Don't collect and reprint the logs. Let them be printed directly.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
This commit is contained in:
Sunil Mohan Adapa 2019-01-28 10:13:54 -08:00
parent b8737ad663
commit f6d3af15ec
No known key found for this signature in database
GPG Key ID: 43EA1CFF0AA7C5F2

View File

@ -36,10 +36,8 @@ def parse_arguments():
def subcommand_get_logs(_):
"""Get latest FreedomBox logs."""
command = ['journalctl', '--no-pager', '-n', '100', '-u', 'plinth']
process = subprocess.run(command, stdout=subprocess.PIPE, check=True)
data = process.stdout.decode()
print(data)
command = ['journalctl', '--no-pager', '--lines=100', '--unit=plinth']
subprocess.run(command, check=True)
def main():