summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
Diffstat (limited to 'options.c')
-rw-r--r--options.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/options.c b/options.c
index c607dee..5cc13f2 100644
--- a/options.c
+++ b/options.c
@@ -40,10 +40,13 @@ static void usage(const char *argv0)
printf("-i, --interactive Modify links interactively\n");
printf("-l, --links Comma-separated list of links descriptors to setup\n");
printf("-p, --print-topology Print the device topology (implies -v)\n");
+ printf(" --print-dot Print the device topology as a dot graph (implies -v)\n");
printf("-r, --reset Reset all links to inactive\n");
printf("-v, --verbose Be verbose\n");
}
+#define OPT_PRINT_DOT 256
+
static struct option opts[] = {
{"device", 1, 0, 'd'},
{"entity", 1, 0, 'e'},
@@ -51,6 +54,7 @@ static struct option opts[] = {
{"help", 0, 0, 'h'},
{"interactive", 0, 0, 'i'},
{"links", 1, 0, 'l'},
+ {"print-dot", 0, 0, OPT_PRINT_DOT},
{"print-topology", 0, 0, 'p'},
{"reset", 0, 0, 'r'},
{"verbose", 0, 0, 'v'},
@@ -105,6 +109,10 @@ int parse_cmdline(int argc, char **argv)
media_opts.verbose = 1;
break;
+ case OPT_PRINT_DOT:
+ media_opts.print_dot = 1;
+ break;
+
default:
printf("Invalid option -%c\n", opt);
printf("Run %s -h for help.\n", argv[0]);