changeset 470:cb2bed53ad8b

Using a placeholder for the scripts name in the script template, so the call syntax will show the correct name of the script. git-svn-id: svn://svn.code.sf.net/p/universalindent/code/trunk@707 59b1889a-e5ac-428c-b0c7-476e01d41282
author thomas_-_s <thomas_-_s@59b1889a-e5ac-428c-b0c7-476e01d41282>
date Mon, 26 May 2008 15:35:45 +0000
parents 0f116c3002d7
children e8376fc4ce74
files src/mainwindow.cpp src/templateBatchScript.h
diffstat 2 files changed, 8 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/src/mainwindow.cpp	Mon May 26 13:05:04 2008 +0000
+++ b/src/mainwindow.cpp	Mon May 26 15:35:45 2008 +0000
@@ -1410,7 +1410,11 @@
     if ( fileName.isEmpty() ) {
         return;
     }
+	
+	// Replace placeholder for script name in script template.
+	indenterCallShellScript = indenterCallShellScript.replace("__INDENTERCALLSTRINGSCRIPTNAME__", fileName);
 
+	// Delete any old file, write the new contents and set executable permissions.
     QFile::remove(fileName);
     QFile outSrcFile(fileName);
     outSrcFile.open( QFile::ReadWrite | QFile::Text );
--- a/src/templateBatchScript.h	Mon May 26 13:05:04 2008 +0000
+++ b/src/templateBatchScript.h	Mon May 26 15:35:45 2008 +0000
@@ -57,8 +57,8 @@
 ":error\n"
 "echo .\n"
 "echo ERROR: As parameter given directory or file does not exist!\n"
-"echo Syntax is: recurse.bat dirname filesuffix\n"
-"echo Syntax is: recurse.bat filename\n"
+"echo Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ dirname filesuffix\n"
+"echo Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ filename\n"
 "echo Example: recurse.bat temp cpp\n"
 "echo .\n"
 "\n"
@@ -97,8 +97,8 @@
         "__INDENTERCALLSTRING2__\n"
     "else\n"
         "echo \"ERROR: As parameter given directory or file does not exist!\"\n"
-        "echo \"Syntax is: recurse.sh dirname filesuffix\"\n"
-        "echo \"Syntax is: recurse.sh filename\"\n"
+        "echo \"Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ dirname filesuffix\"\n"
+        "echo \"Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ filename\"\n"
         "echo \"Example: recurse.sh temp cpp\"\n"
         "exit 1\n"
     "fi\n"