summaryrefslogtreecommitdiff
path: root/options.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-05-21 16:38:55 +0200
committerLaurent Pinchart <laurent.pinchart@ideasonboard.com>2010-05-21 16:38:55 +0200
commit293ec4a8813e6d7d68dc147dff102d3a61396515 (patch)
tree3eef8b74bd68bde1258d27123a44e42e74f9ad51 /options.c
parent23a9a40c33d284ee280b330b1ced9a7b6bcffd89 (diff)
Add --print-dot option to print topology as a dot graph
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
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]);