use dict keys for hint in oom-sort

Using dict keys avoids bugs like typos in the hint.
This fixes the typo oom-sore_adj instead of oom_score_adj ("-" instead of "_" and a missing "c").
This commit is contained in:
Simon Heimberg 2021-01-01 12:41:14 +01:00 committed by GitHub
parent 953b41aa9f
commit 3f68954dc4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -96,9 +96,7 @@ sort_by = args.sort
if sort_by not in sort_dict:
print('Invalid -s/--sort value. Valid values are:\nPID\noom_scor'
'e [default value]\noom-sore_adj\nUID\nName\ncmdline\nVmR'
'SS\nVmSwap')
print('Invalid -s/--sort value. Valid values are:\n' + '\n'.join(sort_dict) + '\n default is oom_score')
exit()