comparison libinterp/options-usage.h @ 22064:bd4f3d2ce52f

provide wrapper for getopt * liboctave/wrappers/getopt-wrapper.c, liboctave/wrappers/getopt-wrapper.h: New files. * liboctave/wrappers/module.mk: Update. * octave.cc, options-usage.h: Use wrapper for getopt.
author John W. Eaton <jwe@octave.org>
date Thu, 07 Jul 2016 13:44:40 -0400
parents 1473547f50f5
children bac0d6f07a3e
comparison
equal deleted inserted replaced
22063:55c20a3e3e59 22064:bd4f3d2ce52f
65 #define NO_LINE_EDITING_OPTION 15 65 #define NO_LINE_EDITING_OPTION 15
66 #define NO_SITE_FILE_OPTION 16 66 #define NO_SITE_FILE_OPTION 16
67 #define PERSIST_OPTION 17 67 #define PERSIST_OPTION 17
68 #define TEXI_MACROS_FILE_OPTION 18 68 #define TEXI_MACROS_FILE_OPTION 18
69 #define TRADITIONAL_OPTION 19 69 #define TRADITIONAL_OPTION 19
70 struct option long_opts[] = 70 struct octave_getopt_options long_opts[] =
71 { 71 {
72 { "braindead", no_argument, 0, TRADITIONAL_OPTION }, 72 { "braindead", octave_no_arg, 0, TRADITIONAL_OPTION },
73 { "built-in-docstrings-file", required_argument, 0, BUILT_IN_DOCSTRINGS_FILE_OPTION }, 73 { "built-in-docstrings-file", octave_required_arg, 0, BUILT_IN_DOCSTRINGS_FILE_OPTION },
74 { "debug", no_argument, 0, 'd' }, 74 { "debug", octave_no_arg, 0, 'd' },
75 { "debug-jit", no_argument, 0, DEBUG_JIT_OPTION }, 75 { "debug-jit", octave_no_arg, 0, DEBUG_JIT_OPTION },
76 { "doc-cache-file", required_argument, 0, DOC_CACHE_FILE_OPTION }, 76 { "doc-cache-file", octave_required_arg, 0, DOC_CACHE_FILE_OPTION },
77 { "echo-commands", no_argument, 0, 'x' }, 77 { "echo-commands", octave_no_arg, 0, 'x' },
78 { "eval", required_argument, 0, EVAL_OPTION }, 78 { "eval", octave_required_arg, 0, EVAL_OPTION },
79 { "exec-path", required_argument, 0, EXEC_PATH_OPTION }, 79 { "exec-path", octave_required_arg, 0, EXEC_PATH_OPTION },
80 { "force-gui", no_argument, 0, FORCE_GUI_OPTION }, 80 { "force-gui", octave_no_arg, 0, FORCE_GUI_OPTION },
81 { "help", no_argument, 0, 'h' }, 81 { "help", octave_no_arg, 0, 'h' },
82 { "image-path", required_argument, 0, IMAGE_PATH_OPTION }, 82 { "image-path", octave_required_arg, 0, IMAGE_PATH_OPTION },
83 { "info-file", required_argument, 0, INFO_FILE_OPTION }, 83 { "info-file", octave_required_arg, 0, INFO_FILE_OPTION },
84 { "info-program", required_argument, 0, INFO_PROG_OPTION }, 84 { "info-program", octave_required_arg, 0, INFO_PROG_OPTION },
85 { "interactive", no_argument, 0, 'i' }, 85 { "interactive", octave_no_arg, 0, 'i' },
86 { "jit-compiler", no_argument, 0, JIT_COMPILER_OPTION }, 86 { "jit-compiler", octave_no_arg, 0, JIT_COMPILER_OPTION },
87 { "line-editing", no_argument, 0, LINE_EDITING_OPTION }, 87 { "line-editing", octave_no_arg, 0, LINE_EDITING_OPTION },
88 { "no-gui", no_argument, 0, NO_GUI_OPTION }, 88 { "no-gui", octave_no_arg, 0, NO_GUI_OPTION },
89 { "no-history", no_argument, 0, 'H' }, 89 { "no-history", octave_no_arg, 0, 'H' },
90 { "no-init-file", no_argument, 0, NO_INIT_FILE_OPTION }, 90 { "no-init-file", octave_no_arg, 0, NO_INIT_FILE_OPTION },
91 { "no-init-path", no_argument, 0, NO_INIT_PATH_OPTION }, 91 { "no-init-path", octave_no_arg, 0, NO_INIT_PATH_OPTION },
92 { "no-line-editing", no_argument, 0, NO_LINE_EDITING_OPTION }, 92 { "no-line-editing", octave_no_arg, 0, NO_LINE_EDITING_OPTION },
93 { "no-site-file", no_argument, 0, NO_SITE_FILE_OPTION }, 93 { "no-site-file", octave_no_arg, 0, NO_SITE_FILE_OPTION },
94 { "no-window-system", no_argument, 0, 'W' }, 94 { "no-window-system", octave_no_arg, 0, 'W' },
95 { "norc", no_argument, 0, 'f' }, 95 { "norc", octave_no_arg, 0, 'f' },
96 { "path", required_argument, 0, 'p' }, 96 { "path", octave_required_arg, 0, 'p' },
97 { "persist", no_argument, 0, PERSIST_OPTION }, 97 { "persist", octave_no_arg, 0, PERSIST_OPTION },
98 { "quiet", no_argument, 0, 'q' }, 98 { "quiet", octave_no_arg, 0, 'q' },
99 { "silent", no_argument, 0, 'q' }, 99 { "silent", octave_no_arg, 0, 'q' },
100 { "texi-macros-file", required_argument, 0, TEXI_MACROS_FILE_OPTION }, 100 { "texi-macros-file", octave_required_arg, 0, TEXI_MACROS_FILE_OPTION },
101 { "traditional", no_argument, 0, TRADITIONAL_OPTION }, 101 { "traditional", octave_no_arg, 0, TRADITIONAL_OPTION },
102 { "verbose", no_argument, 0, 'V' }, 102 { "verbose", octave_no_arg, 0, 'V' },
103 { "version", no_argument, 0, 'v' }, 103 { "version", octave_no_arg, 0, 'v' },
104 { 0, 0, 0, 0 } 104 { 0, 0, 0, 0 }
105 }; 105 };
106 106
107 // Usage message with extra help. 107 // Usage message with extra help.
108 108
109 static void 109 static void