GNU Octave  4.0.0
A high-level interpreted language, primarily intended for numerical computations, mostly compatible with Matlab
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
options-usage.h
Go to the documentation of this file.
1 /*
2 
3 Copyright (C) 1993-2015 John W. Eaton
4 
5 This file is part of Octave.
6 
7 Octave is free software; you can redistribute it and/or modify it
8 under the terms of the GNU General Public License as published by the
9 Free Software Foundation; either version 3 of the License, or (at your
10 option) any later version.
11 
12 Octave is distributed in the hope that it will be useful, but WITHOUT
13 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
14 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
15 for more details.
16 
17 You should have received a copy of the GNU General Public License
18 along with Octave; see the file COPYING. If not, see
19 <http://www.gnu.org/licenses/>.
20 
21 */
22 
23 #if !defined (octave_options_usage_h)
24 #define octave_options_usage_h 1
25 
26 #include <iosfwd>
27 
28 #include "version.h"
29 
30 // Usage message
31 static const char *usage_string =
32  "octave [-HVWdfhiqvx] [--debug] [--debug-jit] [--doc-cache-file file]\n\
33  [--echo-commands] [--eval CODE] [--exec-path path]\n\
34  [--force-gui] [--help] [--image-path path]\n\
35  [--info-file file] [--info-program prog] [--interactive]\n\
36  [--jit-compiler] [--line-editing] [--no-gui] [--no-history]\n\
37  [--no-init-file] [--no-init-path] [--no-line-editing]\n\
38  [--no-site-file] [--no-window-system] [--norc] [-p path]\n\
39  [--path path] [--persist] [--silent] [--traditional]\n\
40  [--verbose] [--version] [file]";
41 
42 // This is here so that it's more likely that the usage message and
43 // the real set of options will agree. Note: the '+' must come first
44 // to prevent getopt from permuting arguments!
45 static const char *short_opts = "+HWVdfhip:qvx";
46 
47 // Long options. See the comments in getopt.h for the meanings of the
48 // fields in this structure.
49 #define BUILT_IN_DOCSTRINGS_FILE_OPTION 1
50 #define DOC_CACHE_FILE_OPTION 2
51 #define EVAL_OPTION 3
52 #define EXEC_PATH_OPTION 4
53 #define FORCE_GUI_OPTION 5
54 #define IMAGE_PATH_OPTION 6
55 #define INFO_FILE_OPTION 7
56 #define INFO_PROG_OPTION 8
57 #define DEBUG_JIT_OPTION 9
58 #define JIT_COMPILER_OPTION 10
59 #define LINE_EDITING_OPTION 11
60 #define NO_GUI_OPTION 12
61 #define NO_INIT_FILE_OPTION 13
62 #define NO_INIT_PATH_OPTION 14
63 #define NO_LINE_EDITING_OPTION 15
64 #define NO_SITE_FILE_OPTION 16
65 #define PERSIST_OPTION 17
66 #define TEXI_MACROS_FILE_OPTION 18
67 #define TRADITIONAL_OPTION 19
68 struct option long_opts[] =
69 {
70  { "braindead", no_argument, 0, TRADITIONAL_OPTION },
71  { "built-in-docstrings-file", required_argument, 0, BUILT_IN_DOCSTRINGS_FILE_OPTION },
72  { "debug", no_argument, 0, 'd' },
73  { "debug-jit", no_argument, 0, DEBUG_JIT_OPTION },
74  { "doc-cache-file", required_argument, 0, DOC_CACHE_FILE_OPTION },
75  { "echo-commands", no_argument, 0, 'x' },
76  { "eval", required_argument, 0, EVAL_OPTION },
77  { "exec-path", required_argument, 0, EXEC_PATH_OPTION },
78  { "force-gui", no_argument, 0, FORCE_GUI_OPTION },
79  { "help", no_argument, 0, 'h' },
80  { "image-path", required_argument, 0, IMAGE_PATH_OPTION },
81  { "info-file", required_argument, 0, INFO_FILE_OPTION },
82  { "info-program", required_argument, 0, INFO_PROG_OPTION },
83  { "interactive", no_argument, 0, 'i' },
84  { "jit-compiler", no_argument, 0, JIT_COMPILER_OPTION },
85  { "line-editing", no_argument, 0, LINE_EDITING_OPTION },
86  { "no-gui", no_argument, 0, NO_GUI_OPTION },
87  { "no-history", no_argument, 0, 'H' },
88  { "no-init-file", no_argument, 0, NO_INIT_FILE_OPTION },
89  { "no-init-path", no_argument, 0, NO_INIT_PATH_OPTION },
90  { "no-line-editing", no_argument, 0, NO_LINE_EDITING_OPTION },
91  { "no-site-file", no_argument, 0, NO_SITE_FILE_OPTION },
92  { "no-window-system", no_argument, 0, 'W' },
93  { "norc", no_argument, 0, 'f' },
94  { "path", required_argument, 0, 'p' },
95  { "persist", no_argument, 0, PERSIST_OPTION },
96  { "quiet", no_argument, 0, 'q' },
97  { "silent", no_argument, 0, 'q' },
98  { "texi-macros-file", required_argument, 0, TEXI_MACROS_FILE_OPTION },
99  { "traditional", no_argument, 0, TRADITIONAL_OPTION },
100  { "verbose", no_argument, 0, 'V' },
101  { "version", no_argument, 0, 'v' },
102  { 0, 0, 0, 0 }
103 };
104 
105 // Usage message with extra help.
106 
107 static void
109 {
111  << "\n\
112 \n\
113 Usage: octave [options] [FILE]\n\
114 \n\
115 Options:\n\
116 \n\
117  --built-in-docstrings-file FILE Use docs for built-ins from FILE.\n\
118  --debug, -d Enter parser debugging mode.\n\
119  --debug-jit Enable JIT compiler debugging/tracing.\n\
120  --doc-cache-file FILE Use doc cache file FILE.\n\
121  --echo-commands, -x Echo commands as they are executed.\n\
122  --eval CODE Evaluate CODE. Exit when done unless --persist.\n\
123  --exec-path PATH Set path for executing subprograms.\n\
124  --force-gui Force graphical user interface to start.\n\
125  --help, -h, Print short help message and exit.\n\
126  --image-path PATH Add PATH to head of image search path.\n\
127  --info-file FILE Use top-level info file FILE.\n\
128  --info-program PROGRAM Use PROGRAM for reading info files.\n\
129  --interactive, -i Force interactive behavior.\n\
130  --jit-compiler Enable the JIT compiler.\n\
131  --line-editing Force readline use for command-line editing.\n\
132  --no-gui Disable the graphical user interface.\n\
133  --no-history, -H Don't save commands to the history list\n\
134  --no-init-file Don't read the ~/.octaverc or .octaverc files.\n\
135  --no-init-path Don't initialize function search path.\n\
136  --no-line-editing Don't use readline for command-line editing.\n\
137  --no-site-file Don't read the site-wide octaverc file.\n\
138  --no-window-system, -W Disable window system, including graphics.\n\
139  --norc, -f Don't read any initialization files.\n\
140  --path PATH, -p PATH Add PATH to head of function search path.\n\
141  --persist Go interactive after --eval or reading from FILE.\n\
142  --silent, --quiet, -q Don't print message at startup.\n\
143  --texi-macros-file FILE Use Texinfo macros in FILE for makeinfo command.\n\
144  --traditional Set variables for closer MATLAB compatibility.\n\
145  --verbose, -V Enable verbose output in some cases.\n\
146  --version, -v Print version number and exit.\n\
147 \n\
148  FILE Execute commands from FILE. Exit when done\n\
149  unless --persist is also specified.\n\
150 \n"
152  << "\n\n"
154  << "\n\n"
156  << "\n";
157 
158  exit (0);
159 }
160 
161 // Terse usage messsage.
162 
163 static void
165 {
166  std::cerr << "\nusage: " << usage_string << "\n\n";
167 
168  exit (1);
169 }
170 
171 static void
173 {
175  << "\n";
176  exit (0);
177 }
178 
179 #endif
#define LINE_EDITING_OPTION
Definition: options-usage.h:59
#define NO_GUI_OPTION
Definition: options-usage.h:60
static void octave_print_version_and_exit(void)
#define INFO_FILE_OPTION
Definition: options-usage.h:55
#define DEBUG_JIT_OPTION
Definition: options-usage.h:57
#define PERSIST_OPTION
Definition: options-usage.h:65
#define IMAGE_PATH_OPTION
Definition: options-usage.h:54
#define NO_SITE_FILE_OPTION
Definition: options-usage.h:64
#define EXEC_PATH_OPTION
Definition: options-usage.h:52
#define TRADITIONAL_OPTION
Definition: options-usage.h:67
#define NO_LINE_EDITING_OPTION
Definition: options-usage.h:63
struct option long_opts[]
Definition: options-usage.h:68
#define TEXI_MACROS_FILE_OPTION
Definition: options-usage.h:66
std::string octave_bugs_statement(bool html)
Definition: version.cc:62
static void octave_print_terse_usage_and_exit(void)
#define EVAL_OPTION
Definition: options-usage.h:51
std::string octave_www_statement(bool html)
Definition: version.cc:47
std::string octave_contrib_statement(bool html)
Definition: version.cc:54
std::string octave_name_version_copyright_copying_warranty_and_bugs(bool html, const std::string &extra_info)
Definition: version.cc:96
static const char * short_opts
Definition: options-usage.h:45
#define DOC_CACHE_FILE_OPTION
Definition: options-usage.h:50
#define BUILT_IN_DOCSTRINGS_FILE_OPTION
Definition: options-usage.h:49
static void octave_print_verbose_usage_and_exit(void)
static const char * usage_string
Definition: options-usage.h:31
#define NO_INIT_PATH_OPTION
Definition: options-usage.h:62
#define NO_INIT_FILE_OPTION
Definition: options-usage.h:61
#define INFO_PROG_OPTION
Definition: options-usage.h:56
#define FORCE_GUI_OPTION
Definition: options-usage.h:53
#define JIT_COMPILER_OPTION
Definition: options-usage.h:58
std::string octave_name_version_copyright_copying_and_warranty(bool html, const std::string &extra_info)
Definition: version.cc:80