Skip to content

Commit a15e799

Browse files
committed
add --no-meters option to hide meters
1 parent 01a3c9e commit a15e799

File tree

2 files changed

+11
-2
lines changed

2 files changed

+11
-2
lines changed

CommandLine.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,8 @@ static void printHelpFlag(const char* name) {
5959
#ifdef HAVE_GETMOUSE
6060
printf("-M --no-mouse Disable the mouse\n");
6161
#endif
62-
printf("-n --max-iterations=NUMBER Exit htop after NUMBER iterations/frame updates\n"
62+
printf(" --no-meters Hide meters\n"
63+
"-n --max-iterations=NUMBER Exit htop after NUMBER iterations/frame updates\n"
6364
"-p --pid=PID[,PID,PID...] Show only the given PIDs\n"
6465
" --readonly Disable all system and process changing features\n"
6566
"-s --sort-key=COLUMN Sort by COLUMN in list view (try --sort-key=help for a list)\n"
@@ -91,6 +92,7 @@ typedef struct CommandLineSettings_ {
9192
bool highlightChanges;
9293
int highlightDelaySecs;
9394
bool readonly;
95+
bool hideMeters;
9496
} CommandLineSettings;
9597

9698
static CommandLineStatus parseArguments(int argc, char** argv, CommandLineSettings* flags) {
@@ -125,6 +127,7 @@ static CommandLineStatus parseArguments(int argc, char** argv, CommandLineSettin
125127
{"no-colour", no_argument, 0, 'C'},
126128
{"no-mouse", no_argument, 0, 'M'},
127129
{"no-unicode", no_argument, 0, 'U'},
130+
{"no-meters", no_argument, 0, 129},
128131
{"tree", no_argument, 0, 't'},
129132
{"pid", required_argument, 0, 'p'},
130133
{"filter", required_argument, 0, 'F'},
@@ -224,6 +227,9 @@ static CommandLineStatus parseArguments(int argc, char** argv, CommandLineSettin
224227
case 'U':
225228
flags->allowUnicode = false;
226229
break;
230+
case 129:
231+
flags->hideMeters = true;
232+
break;
227233
case 't':
228234
flags->treeView = true;
229235
break;
@@ -380,7 +386,7 @@ int CommandLine_run(int argc, char** argv) {
380386
.failedUpdate = NULL,
381387
.pauseUpdate = false,
382388
.hideSelection = false,
383-
.hideMeters = false,
389+
.hideMeters = flags.hideMeters,
384390
};
385391

386392
MainPanel_setState(panel, &state);

htop.1.in

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,9 @@ Do not use unicode but ASCII characters for graph meters
7373
\fB\-M \-\-no-mouse\fR
7474
Disable support of mouse control
7575
.TP
76+
\fB\-\-no-meters\fR
77+
Hide graph meters
78+
.TP
7679
\fB\-\-readonly\fR
7780
Disable all system and process changing features
7881
.TP

0 commit comments

Comments
 (0)