|
View:
New views
5 Messages
—
Rating Filter:
Alert me
|
|
|
[feature-request] different output folders for *.h and *.c and dummy conf fileHi Lorenzo,
my first feature were different output directories for cmdline.h and cmdline.c files. The only setting for now is --output-dir. If I have a directory structure where include files are in include and source files are in src and I want to dynamically create cmdline.* files I must manually copy them to appropriate directories. Where is possible to define --output-header-dir and --output-src-dir? If neither is defined just use --output-dir of default location. the second feature were to create a dummy config file based on the *.ggo one, so that it contains all possible configuration options with their default values and descriptions, but commented out. One can use such a file as example. And it is the very simple to update this conf file if *.ggo one will be changed. For example: gengetopt --make-dummy -i *.ggo Thank you in advance. Best regards, Yegor _______________________________________________ Help-gengetopt mailing list Help-gengetopt@... http://lists.gnu.org/mailman/listinfo/help-gengetopt |
|
|
Re: [feature-request] different output folders for *.h and *.c and dummy conf fileHi Lorenzo,
I've made a quick patch to enable different output folders for *.h and *.c files. Could you review it? Add --header-output-dir and --src_output-dir to store cmdline.h separately from cmdline.c Signed-off-by: Yegor Yefremov <yegorslists@...> Index: gengetopt/src/cmdline.ggo =================================================================== --- gengetopt.orig/src/cmdline.ggo +++ gengetopt/src/cmdline.ggo @@ -73,6 +73,8 @@ option "file-name" F "name of gener option "output-dir" - "output directory" string typestr="path" optional details="\nif this option is not specified, the \ files are generated in the current directory.\n" +option "header-output-dir" - "header output directory" string typestr="path" optional +option "src-output-dir" - "source output directory" string typestr="path" optional option "c-extension" c "extension of c file" string typestr="ext" default="c" optional option "header-extension" H "extension of header file" string typestr="ext" default="h" optional option "long-help" l "long usage line in help" optional Index: gengetopt/src/gengetopt.cc =================================================================== --- gengetopt.orig/src/gengetopt.cc +++ gengetopt/src/gengetopt.cc @@ -108,7 +108,7 @@ main (int argc, char **argv) char *cmdline_filename ; /* name of generated file */ char *c_ext ; /* extenstion of c file */ char *header_ext ; /* extenstion of header file */ - string output_dir; /* output directory (default empty -> current dir)*/ + string output_dir, header_output_dir, src_output_dir; /* output directory (default empty -> current dir)*/ int i, has_help, has_version; FILE *input_file ; @@ -252,6 +252,10 @@ main (int argc, char **argv) if (args_info.output_dir_given) output_dir = args_info.output_dir_arg; + if (args_info.header_output_dir_given) + header_output_dir = args_info.header_output_dir_arg; + if (args_info.src_output_dir_given) + src_output_dir = args_info.src_output_dir_arg; CmdlineParserCreator cmdline_parser_creator (cmdline_parser_name, @@ -273,6 +277,8 @@ main (int argc, char **argv) no_options, command_line.str (), output_dir, + header_output_dir, + src_output_dir, (args_info.show_required_given ? args_info.show_required_arg : "")); if (! gengetopt_package && (args_info.show_version_given || args_info.show_help_given)) Index: gengetopt/src/gm.cc =================================================================== --- gengetopt.orig/src/gm.cc +++ gengetopt/src/gm.cc @@ -167,10 +167,14 @@ CmdlineParserCreator::CmdlineParserCreat bool no_options_, const string &comment_, const string &outdir, + const string &header_outdir, + const string &src_outdir, const string &show_required) : filename (filename_), args_info_name (struct_name), output_dir (outdir), + header_output_dir (header_outdir), + src_output_dir (src_outdir), comment (comment_), unamed_options (unamed_options_), show_required_string (show_required), @@ -378,7 +382,9 @@ CmdlineParserCreator::generate_header_fi /* ****************************************************** */ string header_file = header_filename; - if (output_dir.size()) + if (header_output_dir.size()) + header_file = header_output_dir + "/" + header_file; + else if (output_dir.size()) header_file = output_dir + "/" + header_file; ofstream *output_file = open_fstream @@ -1947,7 +1953,10 @@ CmdlineParserCreator::generate_source () set_getopt_string (generate_getopt_string ()); string output_source = c_filename; - if (output_dir.size()) + + if (src_output_dir.size()) + output_source = src_output_dir + "/" + output_source; + else if (output_dir.size()) output_source = output_dir + "/" + output_source; ofstream *output_file = open_fstream (output_source.c_str()); Index: gengetopt/src/gm.h =================================================================== --- gengetopt.orig/src/gm.h +++ gengetopt/src/gm.h @@ -42,6 +42,8 @@ class CmdlineParserCreator : public head char *header_filename; char *c_filename; string output_dir; + string header_output_dir; + string src_output_dir; string comment; char *unamed_options; string show_required_string; @@ -138,6 +140,8 @@ class CmdlineParserCreator : public head bool gen_version, bool gen_getopt, bool no_options, const string &comment, const string &outdir, + const string &header_outdir, + const string &src_outdir, const string &show_required); int generate(); _______________________________________________ Help-gengetopt mailing list Help-gengetopt@... http://lists.gnu.org/mailman/listinfo/help-gengetopt |
|
|
Re: [feature-request] different output folders for *.h and *.c and dummy conf fileYegor Yefremov wrote:
> Hi Lorenzo, > > I've made a quick patch to enable different output folders for *.h and *.c files. Could you review it? > > > Add --header-output-dir and --src_output-dir to store cmdline.h separately from cmdline.c > thanks for the patch Yegor :-) I'll review it ASAP! cheers Lorenzo -- Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino ICQ# lbetto, 16080134 (GNU/Linux User # 158233) HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com http://www.myspace.com/supertrouperabba BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com http://www.gnu.org/software/src-highlite http://www.gnu.org/software/gengetopt http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net _______________________________________________ Help-gengetopt mailing list Help-gengetopt@... http://lists.gnu.org/mailman/listinfo/help-gengetopt |
|
|
Re: [feature-request] different output folders for *.h and *.c and dummy conf fileYegor Yefremov wrote:
> Hi Lorenzo, > > I've made a quick patch to enable different output folders for *.h and *.c files. Could you review it? > > > Add --header-output-dir and --src_output-dir to store cmdline.h separately from cmdline.c > Hi Yegor your patch is in the CVS right now, and it works like a charm :-) I've also added some tests. If you update, remember to run autoreconf cheers Lorenzo -- Lorenzo Bettini, PhD in Computer Science, DI, Univ. Torino ICQ# lbetto, 16080134 (GNU/Linux User # 158233) HOME: http://www.lorenzobettini.it MUSIC: http://www.purplesucker.com http://www.myspace.com/supertrouperabba BLOGS: http://tronprog.blogspot.com http://longlivemusic.blogspot.com http://www.gnu.org/software/src-highlite http://www.gnu.org/software/gengetopt http://www.gnu.org/software/gengen http://doublecpp.sourceforge.net _______________________________________________ Help-gengetopt mailing list Help-gengetopt@... http://lists.gnu.org/mailman/listinfo/help-gengetopt |
|
|
Re: [feature-request] different output folders for *.h and *.c and dummy conf file>> I've made a quick patch to enable different output folders for *.h and
>> *.c files. Could you review it? >> >> >> Add --header-output-dir and --src_output-dir to store cmdline.h >> separately from cmdline.c >> > > Hi Yegor > > your patch is in the CVS right now, and it works like a charm :-) > > I've also added some tests. > > If you update, remember to run autoreconf I've updated the source tree. Everything is working. Thank you for including this feature. Regards, Yegor _______________________________________________ Help-gengetopt mailing list Help-gengetopt@... http://lists.gnu.org/mailman/listinfo/help-gengetopt |
| Free embeddable forum powered by Nabble | Forum Help |