summaryrefslogtreecommitdiffstats
path: root/commands.c
diff options
context:
space:
mode:
authorMark Wong <markwkm@gmail.com>2009-03-03 20:09:51 -0800
committerMark Wong <markwkm@gmail.com>2009-03-03 20:09:51 -0800
commit843fddfd2484dc9353c50432cccc1e4a77015794 (patch)
treea75df6d9ccf99ff4feee8970f4a6ce37f890db84 /commands.c
parent26f15d8dd5193af6ff23c5b8a55a8b1865b6484c (diff)
Added the ability to sort i/o statistics. Since this was initially
developed for Linux, there will be compiler errors for the other platforms because of changes to parameters passed in a function call. That will need to be fixed.
Diffstat (limited to 'commands.c')
-rw-r--r--commands.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/commands.c b/commands.c
index 95a835d..b3f2bda 100644
--- a/commands.c
+++ b/commands.c
@@ -241,6 +241,7 @@ show_help(struct statics * stp)
{
static char *fullhelp;
char *p = NULL;
+ char *q = NULL;
if (fullhelp == NULL)
{
@@ -253,8 +254,17 @@ show_help(struct statics * stp)
{
p = "not supported";
}
- fullhelp = (char *) malloc(strlen(help_text) + strlen(p) + 2);
- sprintf(fullhelp, help_text, p);
+ if (stp->order_names != NULL)
+ {
+ q = string_list(stp->order_names_io);
+ }
+ if (q == NULL)
+ {
+ q = "not supported";
+ }
+ fullhelp = (char *) malloc(strlen(help_text) + strlen(p) + strlen(q) +
+ 2);
+ sprintf(fullhelp, help_text, p, q);
}
display_pager("Top version ");