Index: .cvsignore
===================================================================
RCS file: /repository/phd/.cvsignore,v
retrieving revision 1.5
diff -u -u -r1.5 .cvsignore
--- .cvsignore	27 Jan 2008 20:31:43 -0000	1.5
+++ .cvsignore	10 Mar 2008 11:02:08 -0000
@@ -11,4 +11,4 @@
 php
 index.ser
 refnames.ser
-
+saved_config.inc
Index: config.php
===================================================================
RCS file: /repository/phd/config.php,v
retrieving revision 1.35
diff -u -u -r1.35 config.php
--- config.php	9 Mar 2008 15:15:29 -0000	1.35
+++ config.php	10 Mar 2008 11:01:55 -0000
@@ -22,6 +22,8 @@
 
 define("PHD_VERSION", "0.2.3-dev");
 
+define("SAVED_SETTINGS", __DIR__ . DIRECTORY_SEPARATOR . 'saved_config.inc');
+
 /* {{{ Default $OPTIONS */
 $OPTIONS = array (
   'output_format' => array('xhtml'),
@@ -52,9 +54,15 @@
   'skip_ids' => array(
   ),
   'output_dir' => '.',
+  'keep' => false,
 );
 /* }}} */
 
+/* {{{ Include any saved settings */
+if (file_exists(SAVED_SETTINGS)) {
+    include_once SAVED_SETTINGS;
+    $OPTIONS["keep"] = false; // Forget to re-save them to preserve any current values and still allow command line params.
+}
 
 /* {{{ getopt() options */
 $opts = array(
@@ -66,6 +74,7 @@
     "partial:" => "p:", // The ID to render (optionally ignoring its children)
     "skip:"    => "s:", // The ID to skip (optionally skipping its children too)
     "verbose:" => "v",  // Adjust the verbosity level
+    "keep"     => "k",  // Keep command line parameters.
     "list::"   => "l::", // List supported themes/formats
     "version"  => "V",  // Print out version information
     "help"     => "h",  // Print out help
@@ -127,6 +136,17 @@
         break;
     /* }}} */
 
+    /* {{{ Keep command line parameters */
+    case "k":
+    case "keep":
+        if (is_array($v)) {
+            v("You cannot pass %s more than once\n", $k);
+            exit(1);
+        }
+        $OPTIONS["keep"] = true;
+        break;
+    /* }}} */
+
     /* {{{ Build format */
     case "f":
     case "format":
@@ -321,6 +341,8 @@
   --list <formats/themes>    Print out the supported formats/themes (default: both)
   -o <directory>
   --output <directory>       The output directory (default: .)
+  -k
+  --keep                     Remember the command line parameters
   -V
   --version                  Print the PhD version information
   -h
@@ -377,6 +399,12 @@
 $OPTIONS["version_info"] = $OPTIONS["xml_root"]."/phpbook/phpbook-xsl/version.xml";
 $OPTIONS["acronyms_file"] = $OPTIONS["xml_root"]."/entities/acronyms.xml";
 
+/* {{{ Keep command line parameters if required. */
+if ($OPTIONS['keep']) {
+	file_put_contents(SAVED_SETTINGS, '<?php $OPTIONS = ' . var_export($OPTIONS, True) . ';');
+	exit(0);
+}
+
 /*
 * vim600: sw=4 ts=4 syntax=php et
 * vim<600: sw=4 ts=4

