Update README and minor changes logs

This commit is contained in:
Thraix
2019-10-10 21:54:53 +02:00
parent 17245655d4
commit 5c302b3363
3 changed files with 16 additions and 5 deletions
+8 -1
View File
@@ -29,13 +29,20 @@ This will install MakeGen into `/usr/bin/makegen`.
If you want it to be installed in another place just run `make` and copy the file to where you want it. If you want it to be installed in another place just run `make` and copy the file to where you want it.
## Usage ## Usage
### Config file
In order to create a MakeGen configuration file use the following command: In order to create a MakeGen configuration file use the following command:
makegen --conf makegen conf gen prompt
This will prompt you with all the needed configurations in order to create a Makefile which will compile your code. This will prompt you with all the needed configurations in order to create a Makefile which will compile your code.
When this is done it will create a file called `makegen.conf` which contains all relevant data for MakeGen to create a Makefile. When this is done it will create a file called `makegen.conf` which contains all relevant data for MakeGen to create a Makefile.
If you want to change your config you can modify the makegen.conf file or use makegens config command line interface.
To see the possible changes you can do see the help file by entering:
makegen conf
### Compiling
After that simply compile your code with: After that simply compile your code with:
makegen makegen
+7 -2
View File
@@ -149,7 +149,7 @@ int ConfigCLI::Gen(int argc, char** argv)
} }
if(argc < 2) if(argc < 2)
{ {
LOG_ERROR("gen needs exactly one parameters"); LOG_ERROR("gen needs exactly one parameter");
return 1; return 1;
} }
std::string option = argv[1]; std::string option = argv[1];
@@ -292,7 +292,7 @@ int ConfigCLI::Get(int argc, char** argv, ConfigFile& config)
} }
if(argc != 2) if(argc != 2)
{ {
LOG_ERROR("get needs exactly one parameters"); LOG_ERROR("get needs exactly one parameter");
return 1; return 1;
} }
auto settingVectorMap = GetSettingVectorMap(config); auto settingVectorMap = GetSettingVectorMap(config);
@@ -336,6 +336,11 @@ int ConfigCLI::Main(int argc, char** argv)
std::string command = argv[1]; std::string command = argv[1];
if(command == "gen") if(command == "gen")
{ {
if(config)
{
LOG_ERROR("Config file already exist (makegen.conf)");
return 1;
}
return Gen(argc-1, &argv[1]); return Gen(argc-1, &argv[1]);
} }
else if(config) else if(config)
-1
View File
@@ -188,6 +188,5 @@ int main(int argc, char** argv)
else else
{ {
LOG_ERROR("No ", CONFIG_FILENAME, " or Makefile found."); LOG_ERROR("No ", CONFIG_FILENAME, " or Makefile found.");
PrintHelp();
} }
} }