Skip to content

Commit a98fa9f

Browse files
committed
add --no-meters option to hide meters
1 parent 79abc57 commit a98fa9f

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

CommandLine.c

Lines changed: 9 additions & 3 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("-m --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, 'm'},
128131
{"tree", no_argument, 0, 't'},
129132
{"pid", required_argument, 0, 'p'},
130133
{"filter", required_argument, 0, 'F'},
@@ -136,7 +139,7 @@ static CommandLineStatus parseArguments(int argc, char** argv, CommandLineSettin
136139

137140
int opt, opti = 0;
138141
/* Parse arguments */
139-
while ((opt = getopt_long(argc, argv, "hVMCs:td:n:u::Up:F:H::", long_opts, &opti))) {
142+
while ((opt = getopt_long(argc, argv, "hVMmCs:td:n:u::Up:F:H::", long_opts, &opti))) {
140143
if (opt == EOF)
141144
break;
142145

@@ -224,6 +227,9 @@ static CommandLineStatus parseArguments(int argc, char** argv, CommandLineSettin
224227
case 'U':
225228
flags->allowUnicode = false;
226229
break;
230+
case 'm':
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
.pauseUpdate = false,
381387
.validUpdate = true,
382388
.hideSelection = false,
383-
.hideMeters = false,
389+
.hideMeters = flags.hideMeters,
384390
};
385391

386392
MainPanel_setState(panel, &state);

0 commit comments

Comments
 (0)