From 27c555883ced250077796bc54f2d5eca0e5c35af Mon Sep 17 00:00:00 2001 From: Egor Tensin Date: Tue, 15 Aug 2023 01:52:59 +0200 Subject: top: fix -E/-e arguments on newer top's --- src/app.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/app.py b/src/app.py index 274ff7b..4d23f36 100755 --- a/src/app.py +++ b/src/app.py @@ -398,8 +398,12 @@ class Top(Command): return Top.COMMAND help_output = run_do('top', '-h') args = ['top', '-b', '-n', '1', '-w', '512'] + memory_scaling_args = ['-E', 'm', '-e', 'm'] if 'Ee' in help_output: - args += ['-E', 'm', '-e', 'm'] + args += memory_scaling_args + else: + if '-E, ' in help_output and '-e, ' in help_output: + args += memory_scaling_args Top.COMMAND = args return Top.COMMAND -- cgit v1.2.3