@@ -15,10 +15,27 @@ lang="c"
1515extension=" c"
1616compiler=" gcc"
1717addInclude=" "
18+ versiontxt=" 1.3.0V"
19+ helptxt=" TermiC $versiontxt \nLicensed under GPLv3\
20+ \n--help -h: \t Shows this help menu
21+ \n--version -v: \t Shows the version number
22+ \n\nC Mode: \ttermic\
23+ \nCPP Mode: \ttermic cpp\
24+ \n\t\ttermic++
25+ \nTCC Mode: \ttermic tcc\
26+ \n\nCommands:\
27+ \nhelp: \t\tShows this help menu\nabort: \t\tAborts inline prompt mode which are entered by curly bracket\
28+ \nshow: \t\tPrints last successfully compiled source file\nshowtmp: \tPrints last compiled source file with deleted edits\
29+ \nsave: \t\tSaves source file to working directory\nsavebin: \tSaves binary file to working directory\
30+ \nclear: \t\tDeletes all declared functions, classes etc. and resets shell\
31+ \nexit: \t\tDeletes created temp files and exits program\
32+ \n\nAuthors:\nYusuf Kagan Hanoglu\nMax Schillinger"
33+ [[ $1 == " -h" || $1 == " --help" ]] && echo -e $helptxt && exit
34+ [[ $1 == " -v" || $1 == " --version" ]] && echo $versiontxt && exit
1835[[ $1 == " tcc" ]] && compiler=" tcc"
1936[[ $1 == " cpp" ]] || [[ $0 =~ \+\+ ]] && lang=" c++" && compiler=" g++ -fpermissive" && extension=" cpp" && addInclude=" #include <iostream>\nusing namespace std;\n"
2037command -v bat > /dev/null 2>&1 && catcmd=" bat -p -l $lang " || catcmd=cat
21- echo TermiC 1.3.0V
38+ echo TermiC $versiontxt
2239echo Language: $lang
2340echo Compiler: $compiler
2441echo Type \' help\' for additional information
@@ -51,14 +68,7 @@ while true;do
5168 [[ $prompt == " showtmp" ]] && { [[ -f $sourceFile .tmp ]] && $catcmd $sourceFile .tmp || echo " No .tmp file!" ; continue ; }
5269 [[ $prompt == " save" ]] && cp $sourceFile $oldPWD && echo " }" >> $oldPWD /$sourceFile && echo " Source file saved to $oldPWD /$sourceFile " && continue
5370 [[ $prompt == " savebin" ]] && cp $binaryFile $oldPWD && echo " Binary file saved to $oldPWD /$binaryFile " && continue
54- [[ $prompt == " help" ]] && echo -e " Designed by Yusuf Kağan Hanoğlu\nLicensed by GPLv3\
55- \nC Mode: ./TermiC.sh\
56- \nCPP Mode: ./TermiC.sh cpp\
57- \n\nCommands:\nhelp: Shows this help menu\nabort: Aborts inline prompt mode which are entered by curly bracket\
58- \nshow: Prints last successfully compiled source file\nshowtmp: Prints last compiled source file with deleted edits\
59- \nsave: Saves source file to working directory\nsavebin: Saves binary file to working directory\
60- \nclear: Deletes all declared functions, classes etc. and resets shell\
61- \nexit: Deletes created temp files and exits program" && continue
71+ [[ $prompt == " help" ]] && echo -e " $helptxt " && continue
6272 fullPrompt=` echo " $fullPrompt " ; echo " $prompt " `
6373 fullPrompt=` echo " $fullPrompt " | sed ' /^[[:blank:]]*$/d' `
6474 inlineOpen=` echo $fullPrompt | grep -o ' {\|#ifdef' | wc -l`
0 commit comments