Index: /trunk/ippTools/src/dettool.c
===================================================================
--- /trunk/ippTools/src/dettool.c	(revision 7319)
+++ /trunk/ippTools/src/dettool.c	(revision 7320)
@@ -22,4 +22,5 @@
 static bool normalizedMode(pxConfig *config);
 static bool normalizedframeMode(pxConfig *config);
+static bool addresidMode(pxConfig *config);
 
 static detInputExpRow *rawDetrenTodetInputExpRow(rawDetrendExpRow *rawExp, psS32 det_id);
@@ -1290,2 +1291,9 @@
     return true;
 }
+
+static bool addresidMode(pxConfig *config)
+{
+    PS_ASSERT_PTR_NON_NULL(config, false);
+
+    return true;
+}
Index: /trunk/ippTools/src/dettool.h
===================================================================
--- /trunk/ippTools/src/dettool.h	(revision 7319)
+++ /trunk/ippTools/src/dettool.h	(revision 7320)
@@ -17,4 +17,5 @@
     DETTOOL_MODE_NORMALIZED,
     DETTOOL_MODE_NORMALIZEDFRAME,
+    DETTOOL_MODE_ADDRESID,
 } dettoolMode;
 
Index: /trunk/ippTools/src/dettoolConfig.c
===================================================================
--- /trunk/ippTools/src/dettoolConfig.c	(revision 7319)
+++ /trunk/ippTools/src/dettoolConfig.c	(revision 7320)
@@ -160,4 +160,19 @@
         "search for recipe", NULL);
 
+    // -addresid
+    psMetadata *addresidArgs = psMetadataAlloc();
+    psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-det_id",  0,
+        "define detrend ID (required)", NULL);
+    psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-iter",  0,
+        "define iteration number", NULL);
+    psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-exp_id",  0,
+        "define detrend ID (required)", NULL);
+    psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-class_id",  0,
+        "define class ID", NULL);
+    psMetadataAddStr(addresidArgs, PS_LIST_TAIL, "-stats",  0,
+        "define stats", NULL);
+    psMetadataAddBool(addresidArgs, PS_LIST_TAIL, "-accpet",  0,
+        "define as having acceptable residuals", false);
+
 #define PXTOOL_MODE(option, modeval, argset) \
     if ((N = psArgumentGet (argc, argv, option))) { \
@@ -191,4 +206,5 @@
     PXTOOL_MODE("-normalized",      DETTOOL_MODE_NORMALIZED,    normalizedArgs);
     PXTOOL_MODE("-normalizedframe", DETTOOL_MODE_NORMALIZEDFRAME,normalizedframeArgs);
+    PXTOOL_MODE("-addresid",        DETTOOL_MODE_ADDRESID,      addresidArgs);
 
     bool argErr = false;
@@ -229,8 +245,8 @@
         psArgumentHelp(stacframeArgs);
         psFree(stacframeArgs);
-        fprintf (stdout, "-addnormalized");
+        fprintf (stdout, "-addnormalized ");
         psArgumentHelp(addnormalizedArgs);
         psFree(addnormalizedArgs);
-        fprintf (stdout, "-normalized");
+        fprintf (stdout, "-normalized ");
         psArgumentHelp(normalizedArgs);
         psFree(normalizedArgs);
@@ -238,4 +254,7 @@
         psArgumentHelp(normalizedframeArgs);
         psFree(normalizedframeArgs);
+        fprintf (stdout, "-addresid ");
+        psArgumentHelp(addresidArgs);
+        psFree(addresidArgs);
 
         exit(EXIT_FAILURE);
@@ -251,4 +270,5 @@
     psFree(stacframeArgs);
     psFree(addnormalizedArgs);
+    psFree(addresidArgs);
 
     // setup search criterion
