diff options
author | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-07-09 14:17:11 +0900 |
---|---|---|
committer | Michele Calgaro <michele.calgaro@yahoo.it> | 2023-07-09 14:17:11 +0900 |
commit | 48a09796d54081ad7f1c5299b1fd699623034d21 (patch) | |
tree | 219f4e02fa7c43cb0891977133df17a72c12b414 /src/__TODO/TemplateBatchScript.cpp | |
parent | 97a6a7874e936017a833c68701b3adf7f709e675 (diff) | |
download | universal-indent-gui-tqt-48a09796d54081ad7f1c5299b1fd699623034d21.tar.gz universal-indent-gui-tqt-48a09796d54081ad7f1c5299b1fd699623034d21.zip |
Added logic to create the indenter calling script
Signed-off-by: Michele Calgaro <michele.calgaro@yahoo.it>
Diffstat (limited to 'src/__TODO/TemplateBatchScript.cpp')
-rw-r--r-- | src/__TODO/TemplateBatchScript.cpp | 74 |
1 files changed, 0 insertions, 74 deletions
diff --git a/src/__TODO/TemplateBatchScript.cpp b/src/__TODO/TemplateBatchScript.cpp deleted file mode 100644 index 56215e1..0000000 --- a/src/__TODO/TemplateBatchScript.cpp +++ /dev/null @@ -1,74 +0,0 @@ -/*************************************************************************** - * Copyright (C) 2006-2012 by Thomas Schweitzer * - * thomas-schweitzer(at)arcor.de * - * * - * This program is free software; you can redistribute it and/or modify * - * it under the terms of the GNU General Public License version 2.0 as * - * published by the Free Software Foundation. * - * * - * This program is distributed in the hope that it will be useful, * - * but WITHOUT ANY WARRANTY; without even the implied warranty of * - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * - * GNU General Public License for more details. * - * * - * You should have received a copy of the GNU General Public License * - * along with this program in the file LICENSE.GPL; if not, write to the * - * Free Software Foundation, Inc., * - * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * - ***************************************************************************/ - -#include "TemplateBatchScript.h" - -/* - \brief The only and static function of this class returns a batch or shell script - as string that can be used to call an indenter with the current settings from - the command line. - - The returned string contains some placeholders where the indenter name needs to - be filled in. The placeholders are "__INDENTERCALLSTRING1__" that should be replaced - by the indenter call string that indents a complete directory. - "__INDENTERCALLSTRING2__" the call string for indenting only one file. - And "__INDENTERCALLSTRINGSCRIPTNAME__" which is only the shown name of the indenter. - */ -const char* TemplateBatchScript::getTemplateBatchScript() -{ - static const char *templateBatchScript = - "#!/bin/sh \n" - "\n" - "if [ ! -n \"$1\" ]; then\n" - "echo \"Syntax is: recurse.sh dirname filesuffix\"\n" - "echo \"Syntax is: recurse.sh filename\"\n" - "echo \"Example: recurse.sh temp cpp\"\n" - "exit 1\n" - "fi\n" - "\n" - "if [ -d \"$1\" ]; then\n" - "#echo \"Dir ${1} exists\"\n" - "if [ -n \"$2\" ]; then\n" - "filesuffix=$2\n" - "else\n" - "filesuffix=\"*\"\n" - "fi\n" - "\n" - "#echo \"Filtering files using suffix ${filesuffix}\"\n" - "\n" - "file_list=`find ${1} -name \"*.${filesuffix}\" -type f`\n" - "for file2indent in $file_list\n" - "do \n" - "echo \"Indenting file $file2indent\"\n" - "__INDENTERCALLSTRING1__\n" - "done\n" - "else\n" - "if [ -f \"$1\" ]; then\n" - "echo \"Indenting one file $1\"\n" - "__INDENTERCALLSTRING2__\n" - "else\n" - "echo \"ERROR: As parameter given directory or file does not exist!\"\n" - "echo \"Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ dirname filesuffix\"\n" - "echo \"Syntax is: __INDENTERCALLSTRINGSCRIPTNAME__ filename\"\n" - "echo \"Example: __INDENTERCALLSTRINGSCRIPTNAME__ temp cpp\"\n" - "exit 1\n" - "fi\n" - "fi\n"; - return templateBatchScript; -} |