From 83d54e79d3990637bb80b1b007f513aa83200f57 Mon Sep 17 00:00:00 2001 From: Robin Gareus Date: Thu, 4 Jul 2019 22:34:04 +0200 Subject: Cleanup headless getopt --- headless/load_session.cc | 30 +++++++++++------------------- 1 file changed, 11 insertions(+), 19 deletions(-) (limited to 'headless/load_session.cc') diff --git a/headless/load_session.cc b/headless/load_session.cc index bcd407f3c8..8705946987 100644 --- a/headless/load_session.cc +++ b/headless/load_session.cc @@ -131,34 +131,26 @@ int main (int argc, char* argv[]) const char *optstring = "vhBdD:c:VOU:P"; const struct option longopts[] = { - { "version", 0, 0, 'v' }, - { "help", 0, 0, 'h' }, - { "bypass-plugins", 1, 0, 'B' }, - { "disable-plugins", 1, 0, 'd' }, - { "debug", 1, 0, 'D' }, - { "name", 1, 0, 'c' }, - { "novst", 0, 0, 'V' }, - { "no-hw-optimizations", 0, 0, 'O' }, - { "uuid", 1, 0, 'U' }, - { "no-connect-ports", 0, 0, 'P' }, + { "version", no_argument, 0, 'v' }, + { "help", no_argument, 0, 'h' }, + { "bypass-plugins", no_argument, 0, 'B' }, + { "disable-plugins", no_argument, 0, 'd' }, + { "debug", required_argument, 0, 'D' }, + { "name", required_argument, 0, 'c' }, + { "novst", no_argument, 0, 'V' }, + { "no-hw-optimizations", no_argument, 0, 'O' }, + { "no-connect-ports", no_argument, 0, 'P' }, { 0, 0, 0, 0 } }; - int option_index = 0; - int c = 0; - bool use_vst = true; bool try_hw_optimization = true; backend_client_name = PBD::downcase (std::string(PROGRAM_NAME)); - while (1) { - c = getopt_long (argc, argv, optstring, longopts, &option_index); - - if (c == -1) { - break; - } + int c; + while ((c = getopt_long (argc, argv, optstring, longopts, (int*)0)) != EOF) { switch (c) { case 0: break; -- cgit v1.2.3