Script 4 – Putting them together
Write a script that invokes the previous two scripts you wrote together to create
a complete C or C++ template file including the header comment
Syntax:
./cCodeMaker.sh [-c|-cpp] [name] [description] -o [outputfile]
Use Case:
./cCodeMaker.sh -cpp "John Doe" "This is a test"
Output:
/*
Author: John Doe
Date: 09/15/2020
Description: This is a test
*/
#include
#include
using std::cout;
using std::cin;
using std::endl;
int main(int argc, char** argv)
{
//TODO: Main code
return 0;
}
Use Case:
./cCodeMaker.sh <-c|-cpp> -o
Example:
./cCodeMaker.sh -cpp "John Doe" "This is a test" -o test.cpp
Output:
Created file test.cpp
**If the user looks at test.cpp
/*
Author: John Doe
Date: 09/15/2020
Description: This is a test
*/
#include
#include
using std::cout;
using std::cin;
using std::endl;
int main(int argc, char** argv)
{
//TODO: Main code
return 0;
}