summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2008-10-30 12:31:40 -0200
committerArnaldo Carvalho de Melo <acme@redhat.com>2008-10-30 12:31:40 -0200
commit426c601013d0537079a406b6748af6b7435d42f5 (patch)
tree1c0707ad14891f114b7776c1b4352b420bb69a38
parent94d557b91617a55b9ecbb4922791be7c062152f5 (diff)
downloadtuna-426c601013d0537079a406b6748af6b7435d42f5.tar.gz
tuna-cmd: Add --version and --spread, that was missing in --helpv0.8.1
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rwxr-xr-xtuna-cmd.py11
1 files changed, 8 insertions, 3 deletions
diff --git a/tuna-cmd.py b/tuna-cmd.py
index eee2909..1fdcac2 100755
--- a/tuna-cmd.py
+++ b/tuna-cmd.py
@@ -26,6 +26,7 @@ except:
nr_cpus = None
ps = None
+version = "0.8.1"
def usage():
print '''Usage: tuna [OPTIONS]
@@ -44,7 +45,9 @@ def usage():
-S, --sockets=CPU-SOCKET-LIST CPU-SOCKET-LIST affected by commands
-t, --threads=THREAD-LIST THREAD-LIST affected by commands
-U, --no_uthreads Operations will not affect user threads
- -W, --what_is Provides help about selected entities'''
+ -v, --version show version
+ -W, --what_is Provides help about selected entities
+ -x, --spread spread selected entities over CPU-LIST'''
def get_nr_cpus():
global nr_cpus
@@ -174,14 +177,14 @@ def do_ps(threads, cpus, show_uthreads, show_kthreads, affect_children):
def main():
try:
opts, args = getopt.getopt(sys.argv[1:],
- "c:CfghiIKmp:Ps:S:t:UWx",
+ "c:CfghiIKmp:Ps:S:t:UvWx",
("cpus=", "affect_children",
"filter", "gui", "help",
"isolate", "include",
"no_kthreads",
"move", "priority=", "show_threads",
"save=", "sockets=", "threads=",
- "no_uthreads", "what_is",
+ "no_uthreads", "version", "what_is",
"spread"))
except getopt.GetoptError, err:
usage()
@@ -251,6 +254,8 @@ def main():
kthreads = False
elif o in ("-U", "--no_uthreads"):
uthreads = False
+ elif o in ("-v", "--version"):
+ print version
elif o in ("-W", "--what_is"):
if not threads:
print "tuna: --what_is requires a thread list!"