diff --git a/CommandLine.c b/CommandLine.c index 6e52f7a54..cfc3faef8 100644 --- a/CommandLine.c +++ b/CommandLine.c @@ -54,12 +54,14 @@ static void printHelpFlag(const char* name) { "-C --no-color Use a monochrome color scheme\n" "-d --delay=DELAY Set the delay between updates, in tenths of seconds\n" "-F --filter=FILTER Show only the commands matching the given filter\n" + " --no-function-bar Hide the function bar\n" "-h --help Print this help screen\n" "-H --highlight-changes[=DELAY] Highlight new and old processes\n", name); #ifdef HAVE_GETMOUSE printf("-M --no-mouse Disable the mouse\n"); #endif - printf("-n --max-iterations=NUMBER Exit htop after NUMBER iterations/frame updates\n" + printf(" --no-meters Hide meters\n" + "-n --max-iterations=NUMBER Exit htop after NUMBER iterations/frame updates\n" "-p --pid=PID[,PID,PID...] Show only the given PIDs\n" " --readonly Disable all system and process changing features\n" "-s --sort-key=COLUMN Sort by COLUMN in list view (try --sort-key=help for a list)\n" @@ -91,6 +93,8 @@ typedef struct CommandLineSettings_ { bool highlightChanges; int highlightDelaySecs; bool readonly; + bool hideMeters; + bool hideFunctionBar; } CommandLineSettings; static CommandLineStatus parseArguments(int argc, char** argv, CommandLineSettings* flags) { @@ -111,6 +115,8 @@ static CommandLineStatus parseArguments(int argc, char** argv, CommandLineSettin .highlightChanges = false, .highlightDelaySecs = -1, .readonly = false, + .hideMeters = false, + .hideFunctionBar = false, }; const struct option long_opts[] = @@ -125,9 +131,12 @@ static CommandLineStatus parseArguments(int argc, char** argv, CommandLineSettin {"no-colour", no_argument, 0, 'C'}, {"no-mouse", no_argument, 0, 'M'}, {"no-unicode", no_argument, 0, 'U'}, + {"no-meters", no_argument, 0, 129}, {"tree", no_argument, 0, 't'}, {"pid", required_argument, 0, 'p'}, {"filter", required_argument, 0, 'F'}, + {"no-functionbar", no_argument, 0, 130}, + {"no-function-bar", no_argument, 0, 130}, {"highlight-changes", optional_argument, 0, 'H'}, {"readonly", no_argument, 0, 128}, PLATFORM_LONG_OPTIONS @@ -224,6 +233,9 @@ static CommandLineStatus parseArguments(int argc, char** argv, CommandLineSettin case 'U': flags->allowUnicode = false; break; + case 129: + flags->hideMeters = true; + break; case 't': flags->treeView = true; break; @@ -255,6 +267,9 @@ static CommandLineStatus parseArguments(int argc, char** argv, CommandLineSettin } free_and_xStrdup(&flags->commFilter, optarg); break; + case 130: + flags->hideFunctionBar = true; + break; case 'H': { const char* delay = optarg; if (!delay && optind < argc && argv[optind] != NULL && @@ -364,6 +379,8 @@ int CommandLine_run(int argc, char** argv) { } ScreenSettings_setSortKey(settings->ss, flags.sortKey); } + if (flags.hideFunctionBar) + settings->hideFunctionBar = 2; host->iterationsRemaining = flags.iterationsRemaining; CRT_init(settings, flags.allowUnicode, flags.iterationsRemaining != -1); @@ -380,7 +397,7 @@ int CommandLine_run(int argc, char** argv) { .failedUpdate = NULL, .pauseUpdate = false, .hideSelection = false, - .hideMeters = false, + .hideMeters = flags.hideMeters, }; MainPanel_setState(panel, &state); diff --git a/htop.1.in b/htop.1.in index e0278ca31..d3834c6a4 100644 --- a/htop.1.in +++ b/htop.1.in @@ -53,6 +53,9 @@ in monochrome mode Filter processes by terms matching the commands. The terms are matched case-insensitive and as fixed strings (not regexs). You can separate multiple terms with "|". .TP +\fB\-\-no-function-bar\fR +Hide the function bar +.TP \fB\-h \-\-help Display a help message and exit .TP @@ -73,6 +76,9 @@ Do not use unicode but ASCII characters for graph meters \fB\-M \-\-no-mouse\fR Disable support of mouse control .TP +\fB\-\-no-meters\fR +Hide graph meters +.TP \fB\-\-readonly\fR Disable all system and process changing features .TP