diff -Naur partimage-0.6.7/src/client/main.cpp partimage-0.6.7-description/src/client/main.cpp --- partimage-0.6.7/src/client/main.cpp 2008-02-03 22:58:00.000000000 +0100 +++ partimage-0.6.7-description/src/client/main.cpp 2008-02-04 14:46:32.000000000 +0100 @@ -83,6 +83,7 @@ {"fully-batch", required_argument, NULL, 'B'}, {"nocheck", no_argument, NULL, 'c'}, {"nodesc", no_argument, NULL, 'd'}, + {"description",required_argument, NULL, 'D'}, {"erase", no_argument, NULL, 'e'}, {"finish", required_argument, NULL, 'f'}, {"debug", required_argument, NULL, 'g'}, @@ -109,7 +110,7 @@ static char finish_last_countfile_lock[]="/tmp/partimageXXXXXX.lock"; static char finish_last_countfile[]="/tmp/partimageXXXXXX"; -static char optstring[]="z:oV:ecmdhf:s:p:bwg:vynSMa:iU:P:XB:"; +static char optstring[]="z:oV:ecmdhf:s:p:bwg:vynSMa:iU:P:XB:D:"; FILE * g_fDebug; // debug file FILE * g_fLocalDebug; // debug file CInterface * g_interface; @@ -312,6 +313,12 @@ options.bAskDesc = false; break; + case 'D': // description in batch mode + strncpy(options.szDescription, optarg, MAX_DESCRIPTION); + *(options.szDescription+MAX_DESCRIPTION-1) = '\0'; + options.bAskDesc = false; + break; + case 'h': // help usage(); return EXIT_SUCCESS; @@ -952,6 +959,7 @@ "* -c, --nocheck don't check the partition before saving\n" "* -o, --overwrite overwrite the existing image file without confirmation\n" "* -d, --nodesc don't ask any description for the image file\n" + "* -DX, --description=X set image description in batch mode\n" "* -V, --volume (split image into multiple volumes files)\n" " -VX, --volume=X create volumes with a size of X MB\n" "* -w, --waitvol wait for a confirmation after each volume change\n" diff -Naur partimage-0.6.7/src/client/misc.cpp partimage-0.6.7-description/src/client/misc.cpp --- partimage-0.6.7/src/client/misc.cpp 2008-02-03 22:58:00.000000000 +0100 +++ partimage-0.6.7-description/src/client/misc.cpp 2008-02-04 14:47:17.000000000 +0100 @@ -437,7 +437,10 @@ g_interface -> askDescription(headMain.szPartDescription, MAX_DESCRIPTION); } - + else if (strlen(options->szDescription)>0) + { + strcpy(headMain.szPartDescription,options->szDescription); + } // bzip2 bug workaround if ((options->dwCompression == COMPRESS_BZIP2) && (!g_interface->getBatchMode())) diff -Naur partimage-0.6.7/src/shared/common.h partimage-0.6.7-description/src/shared/common.h --- partimage-0.6.7/src/shared/common.h 2008-02-03 22:57:55.000000000 +0100 +++ partimage-0.6.7-description/src/shared/common.h 2008-02-04 14:46:32.000000000 +0100 @@ -142,6 +142,7 @@ char szUserName[MAX_USERNAMELEN]; char szPassWord[MAX_PASSWORDLEN]; char szFullyBatchMode[2048]; + char szDescription[MAX_DESCRIPTION]; }; #define MAX_UNAMEINFOLEN 65 //SYS_NMLN