summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Cherepanov <alex.cherepanov@artifex.com>2012-02-24 21:25:08 -0500
committerChris Liddell <chris.liddell@artifex.com>2012-03-15 11:54:23 +0000
commit1ba034503a907ee80ce5c8f5ef5996548f52a38a (patch)
treee2c68c07f0b6bc684a274fe2bf4c3d8913aa2965
parente7022ec2a4088e7689bac2da66abf1427e926ca9 (diff)
Add "-I directories" option.
Add a new form of -I option similar to -o, where the directory list is taken from the next parameter. This form is more convenient to use on UN*X command line with tilda expansion.
-rw-r--r--gs/doc/Use.htm1
-rw-r--r--gs/psi/imainarg.c12
2 files changed, 12 insertions, 1 deletions
diff --git a/gs/doc/Use.htm b/gs/doc/Use.htm
index 8fce72355..506b6b0d5 100644
--- a/gs/doc/Use.htm
+++ b/gs/doc/Use.htm
@@ -2157,6 +2157,7 @@ named on the command line.
<dl>
<dt><a name="I_switch"></a><code>-I</code><em>directories</em>
+<br><code>-I </code><em>directories</em>
<dd>Adds the designated list of directories at the head of the search path
for library files.
</dl>
diff --git a/gs/psi/imainarg.c b/gs/psi/imainarg.c
index f7827888e..258594bfb 100644
--- a/gs/psi/imainarg.c
+++ b/gs/psi/imainarg.c
@@ -459,7 +459,17 @@ run_stdin:
return e_Info; /* show usage info on exit */
case 'I': /* specify search path */
{
- char *path = arg_copy(arg, minst->heap);
+ const char *path;
+
+ if (arg[0] == 0) {
+ path = arg_next(pal, &code);
+ if (code < 0)
+ return code;
+ } else
+ path = arg;
+ if (path == NULL)
+ return e_Fatal;
+ path = arg_copy(path, minst->heap);
if (path == NULL)
return e_Fatal;
gs_main_add_lib_path(minst, path);