git-svn-id: svn://db.shs.com.ru/pip@644 12ceb7fc-bf1f-11e4-8940-5bc7170c53b5
This commit is contained in:
@@ -8,9 +8,10 @@ using namespace PICoutManipulators;
|
||||
void usage() {
|
||||
piCout << Bold << "PIP Resources Compiler";
|
||||
piCout << Cyan << "Version" << Bold << PIPVersion() << NewLine;
|
||||
piCout << Green << Bold << "Usage:" << Default << "\"pirc [-hl] -i <in_file> -o <out_file>\"" << NewLine;
|
||||
piCout << Green << Bold << "Usage:" << Default << "\"pirc [-hl] [-n <name>] -i <in_file> -o <out_file>\"" << NewLine;
|
||||
piCout << Green << Bold << "Details:";
|
||||
piCout << "-h --help " << Green << "- display this message and exit";
|
||||
piCout << "-n --name <name> " << Green << "- name of initialize function, by default is <out_file> base name";
|
||||
piCout << "-i --input <in_file> " << Green << "- resources description file";
|
||||
piCout << "-o --out <out_file> " << Green << "- output .cpp file";
|
||||
piCout << "-l --list " << Green << "- print readed files from description and exit";
|
||||
@@ -21,6 +22,7 @@ int main (int argc, char * argv[]) {
|
||||
PICLI cli(argc, argv);
|
||||
cli.addArgument("input", true);
|
||||
cli.addArgument("out", true);
|
||||
cli.addArgument("name", true);
|
||||
cli.addArgument("help");
|
||||
cli.addArgument("list");
|
||||
|
||||
@@ -47,6 +49,8 @@ int main (int argc, char * argv[]) {
|
||||
}
|
||||
|
||||
PIString out_file = cli.argumentValue("out");
|
||||
PIString init_name = cli.argumentValue("name");
|
||||
init_name = initName(init_name.isEmpty() ? out_file : init_name);
|
||||
PIFile outf;
|
||||
if (!out_file.isEmpty()) {
|
||||
if (outf.open(out_file, PIIODevice::ReadWrite)) {
|
||||
@@ -58,7 +62,7 @@ int main (int argc, char * argv[]) {
|
||||
outf << "// \"" << _a << "\"\n";
|
||||
outf << "\n";
|
||||
//outf << "#include \"pivariant.h\"\n#include \"picodeinfo.h\"";
|
||||
if (!generate(outf, files)) {
|
||||
if (!generate(init_name, outf, files)) {
|
||||
piCout << "Error: generate fail";
|
||||
return 1;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user