summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'options.c')
-rw-r--r--options.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/options.c b/options.c
index a075357..d64ab35 100644
--- a/options.c
+++ b/options.c
@@ -30,7 +30,7 @@
options_t options;
-char optstr[] = "+i:f:nNF:G:lhpbBu:Pm:c:s:tL:o:";
+char optstr[] = "+i:f:nNF:G:lhpbBu:Pm:c:s:tL:o:A";
/* Global options. */
@@ -165,6 +165,7 @@ void options_set_defaults() {
options.timed_output = 0;
options.no_curses = 0;
options.num_lines = 10;
+ options.process_names = 0;
/* Figure out the name for the config file */
s = getenv("HOME");
@@ -204,6 +205,7 @@ static void usage(FILE *fp) {
" -G net6/mask6 show traffic flows in/out of IPv6 network\n"
" -l display and count link-local IPv6 traffic (default: off)\n"
" -P show ports as well as hosts\n"
+" -A show local process names\n"
" -m limit sets the upper limit for the bandwidth scale\n"
" -c config file specifies an alternative configuration file\n"
" -t use text interface without ncurses\n"
@@ -282,9 +284,9 @@ void options_read_args(int argc, char **argv) {
config_set_string("bandwidth-unit", "bytes");
break;
- case 'u':
- config_set_string("bandwidth-unit", optarg);
- break;
+ case 'u':
+ config_set_string("bandwidth-unit", optarg);
+ break;
case 's':
config_set_string("timed-output", optarg);
@@ -308,6 +310,10 @@ void options_read_args(int argc, char **argv) {
options.config_file_specified = 1;
break;
+ case 'A':
+ config_set_string("proc-names", "true");
+ break;
+
case '?':
fprintf(stderr, "iftop: unknown option -%c\n", optopt);
usage(stderr);
@@ -585,6 +591,7 @@ void options_make() {
options_config_get_int("timed-output", &options.timed_output);
options_config_get_bool("no-curses", &options.no_curses);
options_config_get_int("num-lines", &options.num_lines);
+ options_config_get_bool("proc-names", &options.process_names);
options_config_get_net_filter();
options_config_get_net_filter6();
};