aboutsummaryrefslogtreecommitdiffstats
path: root/htop.c
diff options
context:
space:
mode:
authorDaniel Lange <DLange@git.local>2018-04-11 01:26:28 +0200
committerDaniel Lange <DLange@git.local>2018-04-11 01:26:28 +0200
commit097fb9e4a3460fe1b6b3fc645ef97acb44946141 (patch)
tree58ba6c6459b926f555a539fab1ec01ff4e93d9ce /htop.c
parent2f3c2439d8d88cf7c1ecef0bcb2b33f747f3ed06 (diff)
parentc60f4cf3c1d91bd786db8e081699f420f44631f3 (diff)
downloaddebian_htop-097fb9e4a3460fe1b6b3fc645ef97acb44946141.tar.gz
debian_htop-097fb9e4a3460fe1b6b3fc645ef97acb44946141.tar.bz2
debian_htop-097fb9e4a3460fe1b6b3fc645ef97acb44946141.zip
Updated version 2.2.0 from 'upstream/2.2.0'
with Debian dir ed195b175f9cd34e0ba2b22dfecc727ab25e1463
Diffstat (limited to 'htop.c')
-rw-r--r--htop.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/htop.c b/htop.c
index 239b5d6..6db81dd 100644
--- a/htop.c
+++ b/htop.c
@@ -42,6 +42,7 @@ static void printHelpFlag() {
"-d --delay=DELAY Set the delay between updates, in tenths of seconds\n"
"-h --help Print this help screen\n"
"-s --sort-key=COLUMN Sort by COLUMN (try --sort-key=help for a list)\n"
+ "-t --tree Show the tree view by default\n"
"-u --user=USERNAME Show only processes of a given user\n"
"-p --pid=PID,[,PID,PID...] Show only the given PIDs\n"
"-v --version Print version info\n"
@@ -61,6 +62,7 @@ typedef struct CommandLineSettings_ {
int sortKey;
int delay;
bool useColors;
+ bool treeView;
} CommandLineSettings;
static CommandLineSettings parseArguments(int argc, char** argv) {
@@ -71,6 +73,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
.sortKey = 0,
.delay = -1,
.useColors = true,
+ .treeView = false,
};
static struct option long_opts[] =
@@ -82,6 +85,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
{"user", required_argument, 0, 'u'},
{"no-color", no_argument, 0, 'C'},
{"no-colour",no_argument, 0, 'C'},
+ {"tree", no_argument, 0, 't'},
{"pid", required_argument, 0, 'p'},
{"io", no_argument, 0, 'i'},
{0,0,0,0}
@@ -89,7 +93,7 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
int opt, opti=0;
/* Parse arguments */
- while ((opt = getopt_long(argc, argv, "hvCs:d:u:p:i", long_opts, &opti))) {
+ while ((opt = getopt_long(argc, argv, "hvCst::d:u:p:i", long_opts, &opti))) {
if (opt == EOF) break;
switch (opt) {
case 'h':
@@ -127,6 +131,9 @@ static CommandLineSettings parseArguments(int argc, char** argv) {
case 'C':
flags.useColors = false;
break;
+ case 't':
+ flags.treeView = true;
+ break;
case 'p': {
char* argCopy = xStrdup(optarg);
char* saveptr;
@@ -197,6 +204,8 @@ int main(int argc, char** argv) {
settings->delay = flags.delay;
if (!flags.useColors)
settings->colorScheme = COLORSCHEME_MONOCHROME;
+ if (flags.treeView)
+ settings->treeView = true;
CRT_init(settings->delay, settings->colorScheme);

© 2014-2024 Faster IT GmbH | imprint | privacy policy