ps_mem/ps_mem-ennobling-the-s-switch.patch
2013-08-14 15:55:42 +02:00

50 lines
1.7 KiB
Diff

From 0736aab9093ae3043f8e2b11ecc23924ac2b7e01 Mon Sep 17 00:00:00 2001
From: Jaromir Capik <jcapik@redhat.com>
Date: Mon, 12 Aug 2013 14:48:03 +0200
Subject: [PATCH] ps_mem.py: Ennobling the -s switch
Previously the longopt variant of the -s switch
didn't make much sense. This commit changes the
--split-args switch to the --show-cmdline switch
and adds the switch in the help/usage message
since it was completely missing there.
---
scripts/ps_mem.py | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/scripts/ps_mem.py b/scripts/ps_mem.py
index 92be618..b30dc30 100755
--- a/scripts/ps_mem
+++ b/scripts/ps_mem
@@ -139,7 +139,7 @@ proc = Proc()
def parse_options():
try:
- long_options = ['split-args', 'help']
+ long_options = ['show-cmdline', 'help']
opts, args = getopt.getopt(sys.argv[1:], "shp:w:", long_options)
except getopt.GetoptError:
sys.stderr.write(help())
@@ -151,7 +151,7 @@ def parse_options():
watch = None
for o, a in opts:
- if o in ('-s', '--split-args'):
+ if o in ('-s', '--show-cmdline'):
split_args = True
if o in ('-h', '--help'):
sys.stdout.write(help())
@@ -176,7 +176,8 @@ def help():
'\n'\
'-h Show this help\n'\
'-w <N> Measure and show process memory every N seconds\n'\
- '-p <pid>[,pid2,...pidN] Only show memory usage PIDs in the specified list\n'
+ '-p <pid>[,pid2,...pidN] Only show memory usage PIDs in the specified list\n' \
+ '-s, --show-cmdline Show cmdline\n'
return help_msg
--
1.8.3.1