
The variable name may only contain letters of the English alphabet or digits, or the underscore character. The variable name must always be the first item specified for each parameter. The var_type, and switch parameters can be in any order. I will update the code if there are any issues. Linux used to work, and while I expect no issues, it is possible that file platform_os.h and the Makefile might need some tweaking for Linux. I have been compiling recently on Windows using Visual Studio. The user must supply a file name after the batch file name.


This Windows TM batch file runs the program to produce a sample program. Even if C code is being generated, the latest C++ 11 keywords are prohibited.Ĭreates file get_arg_info.c and get_arg_info.h, which are used to parse the C or C++ arguments.Ĭreates header file platform_os.h, which is used to define platform and operating specific symbols. Stores whether to generate a C or C++ program and other program attributes. Stores type, name, and default value information for the generated program arguments. The main code generator, which creates the C or C++ code main file that parses the arguments and displays them. The main program file that parses the input arguments and calls other python files to create the generated files. The program is made up of the following files: make_c_cpp_prog.py The program was written with Python version 2.7, but it should also run with Python 2.6. The code also has more features, which can be seen by accessing the help by typing: The new code generates a parser that will allow combining boolean options on a line, i.e., in the generated C or C++ program, instead of having to do " -a -b -c" on the command line, the user could instead use the argument, " -abc". Update: February 11, 2019Ī new upload now generates Visual Studio 17 (and 15?) build files.įormer file get_arguments_function_creator.py is replaced with get_arg_info_creator.py. While the program produces code that runs, it is expected that the user will want to modify the generated code.Ī folder is created with the same name as the base name of the program name passed on the command line and the generated code is created in this folder.

The program is intended to save typing when writing a C or C++ console program. The purpose of this program is to save typing and allowing the rapid creation of programs that can be modified for some intended purpose. This program generates C or C++ programs that parse command-line arguments and display the parsed values.
