diff options
author | David Robillard <d@drobilla.net> | 2009-05-28 23:09:48 +0000 |
---|---|---|
committer | David Robillard <d@drobilla.net> | 2009-05-28 23:09:48 +0000 |
commit | a1b651326087ffce165635af4fba1c70c16b5b31 (patch) | |
tree | 999f7177f57de778e3e68e86374bcc92eb1c4960 /src/ingen | |
parent | 61668850d52490fcd2dc5d4023c897bbc3907231 (diff) | |
download | ingen-a1b651326087ffce165635af4fba1c70c16b5b31.tar.gz ingen-a1b651326087ffce165635af4fba1c70c16b5b31.tar.bz2 ingen-a1b651326087ffce165635af4fba1c70c16b5b31.zip |
Tidy up command line arguments.
git-svn-id: http://svn.drobilla.net/lad/trunk/ingen@2043 a436a847-0d15-0410-975c-d299462d15a1
Diffstat (limited to 'src/ingen')
-rw-r--r-- | src/ingen/cmdline.c | 70 | ||||
-rw-r--r-- | src/ingen/cmdline.ggo | 4 | ||||
-rw-r--r-- | src/ingen/cmdline.h | 20 | ||||
-rw-r--r-- | src/ingen/main.cpp | 2 |
4 files changed, 48 insertions, 48 deletions
diff --git a/src/ingen/cmdline.c b/src/ingen/cmdline.c index 39ffff3e..5724160a 100644 --- a/src/ingen/cmdline.c +++ b/src/ingen/cmdline.c @@ -17,7 +17,7 @@ #include <stdlib.h> #include <string.h> -#include <getopt.h> +#include "getopt.h" #include "cmdline.h" @@ -28,18 +28,18 @@ const char *gengetopt_args_info_usage = "Usage: ingen [OPTIONS]..."; const char *gengetopt_args_info_description = "Ingen can be run in various configurations. The engine can\nrun as a stand-alone server controlled by OSC, or internal to\nanother process (e.g. the GUI). The GUI can communicate with the engine\nvia either method, and many GUIs (or other things) may connect to an\nengine via OSC.\n\nExamples:\n\n ingen -e - Run an engine, listen for OSC \n ingen -g - Run a GUI, connect via OSC \n ingen -eg - Run an engine and a GUI in one process\n\nThe -l (load) option can be used in all cases:\n \n ingen -el patch.ingen.ttl - Run an engine and load a patch\n ingen -gl patch.ingen.ttl - Run a GUI and load a patch\n ingen -egl patch.ingen.ttl - Run an engine and a GUI and load a patch\n\nOptions:\n"; const char *gengetopt_args_info_help[] = { - " -h, --help Print help and exit", - " -V, --version Print version and exit", - " -C, --client-port=INT Client OSC port", - " -c, --connect=STRING Connect to existing engine at URI \n (default=`osc.udp://localhost:16180')", - " -e, --engine Run (JACK) engine (default=off)", - " -E, --engine-port=INT Engine OSC port (default=`16180')", - " -g, --gui Launch the GTK graphical interface (default=off)", - " -n, --jack-name=STRING JACK client name (default=`ingen')", - " -l, --load=STRING Load patch", - " -p, --parallelism=INT Number of concurrent process threads (default=`1')", - " -L, --path=STRING Target path for loaded patch", - " -r, --run=STRING Run script", + " -h, --help Print help and exit", + " -V, --version Print version and exit", + " -C, --client-port=INT Client OSC port", + " -c, --connect=STRING Connect to existing engine at URI \n (default=`osc.udp://localhost:16180')", + " -e, --engine Run (JACK) engine (default=off)", + " -E, --engine-port=INT Engine listen port (default=`16180')", + " -n, --engine-name=STRING Engine JACK client name (default=`ingen')", + " -g, --gui Launch the GTK graphical interface (default=off)", + " -l, --load=STRING Load patch", + " -p, --parallelism=INT Number of concurrent process threads (default=`1')", + " -L, --path=STRING Target path for loaded patch", + " -r, --run=STRING Run script", 0 }; @@ -71,8 +71,8 @@ void clear_given (struct gengetopt_args_info *args_info) args_info->connect_given = 0 ; args_info->engine_given = 0 ; args_info->engine_port_given = 0 ; + args_info->engine_name_given = 0 ; args_info->gui_given = 0 ; - args_info->jack_name_given = 0 ; args_info->load_given = 0 ; args_info->parallelism_given = 0 ; args_info->path_given = 0 ; @@ -88,9 +88,9 @@ void clear_args (struct gengetopt_args_info *args_info) args_info->engine_flag = 0; args_info->engine_port_arg = 16180; args_info->engine_port_orig = NULL; + args_info->engine_name_arg = gengetopt_strdup ("ingen"); + args_info->engine_name_orig = NULL; args_info->gui_flag = 0; - args_info->jack_name_arg = gengetopt_strdup ("ingen"); - args_info->jack_name_orig = NULL; args_info->load_arg = NULL; args_info->load_orig = NULL; args_info->parallelism_arg = 1; @@ -113,8 +113,8 @@ void init_args_info(struct gengetopt_args_info *args_info) args_info->connect_help = gengetopt_args_info_help[3] ; args_info->engine_help = gengetopt_args_info_help[4] ; args_info->engine_port_help = gengetopt_args_info_help[5] ; - args_info->gui_help = gengetopt_args_info_help[6] ; - args_info->jack_name_help = gengetopt_args_info_help[7] ; + args_info->engine_name_help = gengetopt_args_info_help[6] ; + args_info->gui_help = gengetopt_args_info_help[7] ; args_info->load_help = gengetopt_args_info_help[8] ; args_info->parallelism_help = gengetopt_args_info_help[9] ; args_info->path_help = gengetopt_args_info_help[10] ; @@ -201,8 +201,8 @@ cmdline_parser_release (struct gengetopt_args_info *args_info) free_string_field (&(args_info->connect_arg)); free_string_field (&(args_info->connect_orig)); free_string_field (&(args_info->engine_port_orig)); - free_string_field (&(args_info->jack_name_arg)); - free_string_field (&(args_info->jack_name_orig)); + free_string_field (&(args_info->engine_name_arg)); + free_string_field (&(args_info->engine_name_orig)); free_string_field (&(args_info->load_arg)); free_string_field (&(args_info->load_orig)); free_string_field (&(args_info->parallelism_orig)); @@ -251,10 +251,10 @@ cmdline_parser_dump(FILE *outfile, struct gengetopt_args_info *args_info) write_into_file(outfile, "engine", 0, 0 ); if (args_info->engine_port_given) write_into_file(outfile, "engine-port", args_info->engine_port_orig, 0); + if (args_info->engine_name_given) + write_into_file(outfile, "engine-name", args_info->engine_name_orig, 0); if (args_info->gui_given) write_into_file(outfile, "gui", 0, 0 ); - if (args_info->jack_name_given) - write_into_file(outfile, "jack-name", args_info->jack_name_orig, 0); if (args_info->load_given) write_into_file(outfile, "load", args_info->load_orig, 0); if (args_info->parallelism_given) @@ -517,8 +517,8 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf { "connect", 1, NULL, 'c' }, { "engine", 0, NULL, 'e' }, { "engine-port", 1, NULL, 'E' }, + { "engine-name", 1, NULL, 'n' }, { "gui", 0, NULL, 'g' }, - { "jack-name", 1, NULL, 'n' }, { "load", 1, NULL, 'l' }, { "parallelism", 1, NULL, 'p' }, { "path", 1, NULL, 'L' }, @@ -526,7 +526,7 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf { NULL, 0, NULL, 0 } }; - c = getopt_long (argc, argv, "hVC:c:eE:gn:l:p:L:r:", long_options, &option_index); + c = getopt_long (argc, argv, "hVC:c:eE:n:gl:p:L:r:", long_options, &option_index); if (c == -1) break; /* Exit from `while (1)' loop. */ @@ -576,7 +576,7 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf goto failure; break; - case 'E': /* Engine OSC port. */ + case 'E': /* Engine listen port. */ if (update_arg( (void *)&(args_info->engine_port_arg), @@ -588,24 +588,24 @@ cmdline_parser_internal (int argc, char * const *argv, struct gengetopt_args_inf goto failure; break; - case 'g': /* Launch the GTK graphical interface. */ + case 'n': /* Engine JACK client name. */ - if (update_arg((void *)&(args_info->gui_flag), 0, &(args_info->gui_given), - &(local_args_info.gui_given), optarg, 0, 0, ARG_FLAG, - check_ambiguity, override, 1, 0, "gui", 'g', + if (update_arg( (void *)&(args_info->engine_name_arg), + &(args_info->engine_name_orig), &(args_info->engine_name_given), + &(local_args_info.engine_name_given), optarg, 0, "ingen", ARG_STRING, + check_ambiguity, override, 0, 0, + "engine-name", 'n', additional_error)) goto failure; break; - case 'n': /* JACK client name. */ + case 'g': /* Launch the GTK graphical interface. */ - if (update_arg( (void *)&(args_info->jack_name_arg), - &(args_info->jack_name_orig), &(args_info->jack_name_given), - &(local_args_info.jack_name_given), optarg, 0, "ingen", ARG_STRING, - check_ambiguity, override, 0, 0, - "jack-name", 'n', + if (update_arg((void *)&(args_info->gui_flag), 0, &(args_info->gui_given), + &(local_args_info.gui_given), optarg, 0, 0, ARG_FLAG, + check_ambiguity, override, 1, 0, "gui", 'g', additional_error)) goto failure; diff --git a/src/ingen/cmdline.ggo b/src/ingen/cmdline.ggo index 11a56455..2892e65a 100644 --- a/src/ingen/cmdline.ggo +++ b/src/ingen/cmdline.ggo @@ -27,9 +27,9 @@ Options: option "client-port" C "Client OSC port" int no option "connect" c "Connect to existing engine at URI" string no default="osc.udp://localhost:16180" option "engine" e "Run (JACK) engine" flag off -option "engine-port" E "Engine OSC port" int no default="16180" +option "engine-port" E "Engine listen port" int no default="16180" +option "engine-name" n "Engine JACK client name" string no default="ingen" option "gui" g "Launch the GTK graphical interface" flag off -option "jack-name" n "JACK client name" string no default="ingen" option "load" l "Load patch" string no option "parallelism" p "Number of concurrent process threads" int no default="1" option "path" L "Target path for loaded patch" string no diff --git a/src/ingen/cmdline.h b/src/ingen/cmdline.h index e185ffbe..0a798e6c 100644 --- a/src/ingen/cmdline.h +++ b/src/ingen/cmdline.h @@ -1,6 +1,6 @@ /** @file cmdline.h * @brief The header file for the command line option parser - * generated by GNU Gengetopt + * generated by GNU Gengetopt * http://www.gnu.org/software/gengetopt. * DO NOT modify this file, since it can be overwritten * @author GNU Gengetopt by Lorenzo Bettini */ @@ -42,14 +42,14 @@ struct gengetopt_args_info const char *connect_help; /**< @brief Connect to existing engine at URI help description. */ int engine_flag; /**< @brief Run (JACK) engine (default=off). */ const char *engine_help; /**< @brief Run (JACK) engine help description. */ - int engine_port_arg; /**< @brief Engine OSC port (default='16180'). */ - char * engine_port_orig; /**< @brief Engine OSC port original value given at command line. */ - const char *engine_port_help; /**< @brief Engine OSC port help description. */ + int engine_port_arg; /**< @brief Engine listen port (default='16180'). */ + char * engine_port_orig; /**< @brief Engine listen port original value given at command line. */ + const char *engine_port_help; /**< @brief Engine listen port help description. */ + char * engine_name_arg; /**< @brief Engine JACK client name (default='ingen'). */ + char * engine_name_orig; /**< @brief Engine JACK client name original value given at command line. */ + const char *engine_name_help; /**< @brief Engine JACK client name help description. */ int gui_flag; /**< @brief Launch the GTK graphical interface (default=off). */ const char *gui_help; /**< @brief Launch the GTK graphical interface help description. */ - char * jack_name_arg; /**< @brief JACK client name (default='ingen'). */ - char * jack_name_orig; /**< @brief JACK client name original value given at command line. */ - const char *jack_name_help; /**< @brief JACK client name help description. */ char * load_arg; /**< @brief Load patch. */ char * load_orig; /**< @brief Load patch original value given at command line. */ const char *load_help; /**< @brief Load patch help description. */ @@ -62,15 +62,15 @@ struct gengetopt_args_info char * run_arg; /**< @brief Run script. */ char * run_orig; /**< @brief Run script original value given at command line. */ const char *run_help; /**< @brief Run script help description. */ - + unsigned int help_given ; /**< @brief Whether help was given. */ unsigned int version_given ; /**< @brief Whether version was given. */ unsigned int client_port_given ; /**< @brief Whether client-port was given. */ unsigned int connect_given ; /**< @brief Whether connect was given. */ unsigned int engine_given ; /**< @brief Whether engine was given. */ unsigned int engine_port_given ; /**< @brief Whether engine-port was given. */ + unsigned int engine_name_given ; /**< @brief Whether engine-name was given. */ unsigned int gui_given ; /**< @brief Whether gui was given. */ - unsigned int jack_name_given ; /**< @brief Whether jack-name was given. */ unsigned int load_given ; /**< @brief Whether load was given. */ unsigned int parallelism_given ; /**< @brief Whether parallelism was given. */ unsigned int path_given ; /**< @brief Whether path was given. */ @@ -161,7 +161,7 @@ void cmdline_parser_print_help(void); void cmdline_parser_print_version(void); /** - * Initializes all the fields a cmdline_parser_params structure + * Initializes all the fields a cmdline_parser_params structure * to their default values * @param params the structure to initialize */ diff --git a/src/ingen/main.cpp b/src/ingen/main.cpp index d3f6d8f0..647aa9dd 100644 --- a/src/ingen/main.cpp +++ b/src/ingen/main.cpp @@ -209,7 +209,7 @@ main(int argc, char** argv) void* jack_client) = NULL; if (engine_jack_module->get_symbol("new_jack_audio_driver", (void*&)new_driver)) { engine->set_driver(DataType::AUDIO, SharedPtr<Driver>(new_driver( - *engine, "default", args.jack_name_arg, NULL))); + *engine, "default", args.engine_name_arg, NULL))); } else { cerr << Glib::Module::get_last_error() << endl; } |