From b60b2b9ac0dfbdfcc1d89b881c78edc2365f52ce Mon Sep 17 00:00:00 2001 From: "Emden R. Gansner" Date: Thu, 14 Nov 2013 12:18:50 -0500 Subject: [PATCH] Add -s flag (as in dot -s) to gvedit --- cmd/gvedit/gvedit.1 | 17 +++++++++++++++++ cmd/gvedit/main.cpp | 10 +++++++--- 2 files changed, 24 insertions(+), 3 deletions(-) diff --git a/cmd/gvedit/gvedit.1 b/cmd/gvedit/gvedit.1 index 3d16ff106..5369aac0d 100644 --- a/cmd/gvedit/gvedit.1 +++ b/cmd/gvedit/gvedit.1 @@ -4,6 +4,9 @@ gvedit \- simple graph editor and viewer .SH SYNOPSIS .B gvedit [ +.B \-sv? +] +[ .I file ] .SH DESCRIPTION @@ -13,6 +16,20 @@ same time. The text of each graph is displayed in its own text window. .P The name of a Graphviz file can be specified on the command line. This graph file will be automatically opened on start-up. +.SH OPTIONS +The following options are supported: +.TP +.B \-s +By default, the layout algorithms that use initial positions given by a node's pos attribute +(currently, fdp and neato) assume the coordinates are in inches. Frequently, the input graph +has these in points, especially if the graph is output by a Graphviz layout algorithm. This flag +can be used to scale the coordinates from points to inches. +.TP +.B \-v +Verbose mode. +.TP +.B \-? +Prints usage information and exit. .SH AUTHOR Arif Bilgin .br diff --git a/cmd/gvedit/main.cpp b/cmd/gvedit/main.cpp index 13b68a386..faa809596 100644 --- a/cmd/gvedit/main.cpp +++ b/cmd/gvedit/main.cpp @@ -48,8 +48,9 @@ static char *cmd; QTextStream errout(stderr, QIODevice::WriteOnly); static char *useString = "Usage: gvedit [-v?] \n\ - -v - verbose\n\ - -? - print usage\n"; + -s - Scale input by 72\n\ + -v - verbose\n\ + -? - print usage\n"; static void usage(int v) { @@ -62,8 +63,11 @@ static char **parseArgs(int argc, char *argv[]) int c; cmd = argv[0]; - while ((c = getopt(argc, argv, ":v?")) != -1) { + while ((c = getopt(argc, argv, ":sv?")) != -1) { switch (c) { + case 's': + PSinputscale = POINTS_PER_INCH; + break; case 'v': Verbose = 1; break; -- 2.40.0