Hi Sebastian, This looks like a great idea.
Is there a library that we can use for option parsing?
cheers, Johan
On 9-1-2015 11:37, Sebastian Zartner wrote:
The command line parameter list of Inkscape is quite long - 44 parameters to be precise. It splits similar functionality into multiple parameters while it doesn't offer all possible options. On the other side it offers some functions, which may be unnecessary or just too complex.
So I suggest to restructure the command line functionality to separate the actual commands from their parameters. A good example for how that works is the git command line tool http://www.git-scm.com/downloads.
So the commands would be
open convert query version help
The syntax for 'open' would be
open <file path>
The syntax for 'convert' would be
convert -in=<input file name>-out=<output file name> [-out-type=<outupt file type>][-edit=<edit function>] [-area=drawing|page|<object id>|<x0>:<y0>:<x1>:<y1>] [-id-only] [-width=<width>][-height=<height>] [-dpi=<dpi>] [-vacuum-defs] [-background=<color>][-text-to-path] [-margin] [-ignore-filters] [-version=<file type version>]
covering all --export-* parameters and the -vacuum-defsparameter and where the different --export-<file type>parameters are combined in the optional -out-type parameter. -edit replaces --verb by allowing to apply different transformations and filters. (Are there other use cases for --verb than that?) If -out-type is not defined, the type will be inferred from the extension of the file name given in -out.
Syntax for 'query' would be
query x|y|width|height|all -in=<input file name> [-id=<object id>]
covering all --query-*parameters.
'version' and 'help' wouldn't have any parameters and do what --version and --help currently do.
--with-gui, --without-gui, --select, --export-use-hints(rather confusing than helping) and --verb-list (needs a different implementation, probably via 'help') and --usage (should be shown in the output of 'help') are removed as they are not needed anymore. --print, --export-area-snap, --export-latex and --shell are not listed, because I'm not sure about their usage.
Usage examples:
inkscape version
inkscape open "/path/to/file"
inkscape help
inkscape query width -in="/path/to/input file" -id=path1234
inkscape convert -in="/path/to/input file" -out="/path/to/output file" -edit=grayscale,move(1.0 1.0) -vacuum-defs
Sebastian
Dive into the World of Parallel Programming! The Go Parallel Website, sponsored by Intel and developed in partnership with Slashdot Media, is your hub for all things parallel software development, from weekly thought leadership blogs to news, videos, case studies, tutorials and more. Take a look and join the conversation now. http://goparallel.sourceforge.net
Inkscape-devel mailing list Inkscape-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/inkscape-devel