# HG changeset patch # User Rik # Date 1371667002 25200 # Node ID 8d188159ce5f1728a0f84e5fe7c5f28ffbe56478 # Parent 3542e106c496f04c339946ff6b9d67c3c5305e7f Add -W command line option to disable window system (bug #38937) * libinterp/octave.cc: Add -W as a short form of --no-window-system option. * doc/interpreter/basics.txi: Add -W command line form to documentation. diff -r 3542e106c496 -r 8d188159ce5f doc/interpreter/basics.txi --- a/doc/interpreter/basics.txi Sun Apr 28 22:12:20 2013 +0200 +++ b/doc/interpreter/basics.txi Wed Jun 19 11:36:42 2013 -0700 @@ -185,7 +185,8 @@ @cindex @code{--no-site-file} Don't read the site-wide @file{octaverc} initialization files. -@item --no-window-system +@item --no-window-system +@itemx -W @cindex @code{--no-window-system} Disable use of a windowing system including graphics. This forces a strictly terminal-only environment. diff -r 3542e106c496 -r 8d188159ce5f libinterp/octave.cc --- a/libinterp/octave.cc Sun Apr 28 22:12:20 2013 +0200 +++ b/libinterp/octave.cc Wed Jun 19 11:36:42 2013 -0700 @@ -150,12 +150,12 @@ static std::string image_path; // If TRUE, ignore the window system even if it is available. -// (--no-window-system) +// (--no-window-system, -W) static bool no_window_system = false; // Usage message static const char *usage_string = - "octave [-HVdfhiqvx] [--debug] [--echo-commands] [--eval CODE]\n\ + "octave [-HVWdfhiqvx] [--debug] [--echo-commands] [--eval CODE]\n\ [--exec-path path] [--force-gui] [--help] [--image-path path]\n\ [--info-file file] [--info-program prog] [--interactive]\n\ [--jit-debugging] [--line-editing] [--no-gui] [--no-history]\n\ @@ -167,7 +167,7 @@ // This is here so that it's more likely that the usage message and // the real set of options will agree. Note: the '+' must come first // to prevent getopt from permuting arguments! -static const char *short_opts = "+HVdfhip:qvx"; +static const char *short_opts = "+HWVdfhip:qvx"; // The code to evaluate at startup (--eval CODE) static std::string code_to_eval; @@ -199,10 +199,9 @@ #define NO_JIT_COMPILER_OPTION 14 #define NO_LINE_EDITING_OPTION 15 #define NO_SITE_FILE_OPTION 16 -#define NO_WINDOW_SYSTEM_OPTION 17 -#define PERSIST_OPTION 18 -#define TEXI_MACROS_FILE_OPTION 19 -#define TRADITIONAL_OPTION 20 +#define PERSIST_OPTION 17 +#define TEXI_MACROS_FILE_OPTION 18 +#define TRADITIONAL_OPTION 19 struct option long_opts[] = { { "braindead", no_argument, 0, TRADITIONAL_OPTION }, { "built-in-docstrings-file", required_argument, 0, BUILT_IN_DOCSTRINGS_FILE_OPTION }, @@ -226,7 +225,7 @@ { "no-jit-compiler", no_argument, 0, NO_JIT_COMPILER_OPTION }, { "no-line-editing", no_argument, 0, NO_LINE_EDITING_OPTION }, { "no-site-file", no_argument, 0, NO_SITE_FILE_OPTION }, - { "no-window-system", no_argument, 0, NO_WINDOW_SYSTEM_OPTION }, + { "no-window-system", no_argument, 0, 'W' }, { "norc", no_argument, 0, 'f' }, { "path", required_argument, 0, 'p' }, { "persist", no_argument, 0, PERSIST_OPTION }, @@ -542,7 +541,7 @@ --no-jit-compiler Disable the JIT compiler.\n\ --no-line-editing Don't use readline for command-line editing.\n\ --no-site-file Don't read the site-wide octaverc file.\n\ - --no-window-system Disable window system, including graphics.\n\ + --no-window-system, -W Disable window system, including graphics.\n\ --norc, -f Don't read any initialization files.\n\ --path PATH, -p PATH Add PATH to head of function search path.\n\ --persist Go interactive after --eval or reading from FILE.\n\ @@ -685,6 +684,10 @@ read_history_file = false; break; + case 'W': + no_window_system = true; + break; + case 'V': verbose_flag = true; break; @@ -803,10 +806,6 @@ read_site_files = 0; break; - case NO_WINDOW_SYSTEM_OPTION: - no_window_system = true; - break; - case PERSIST_OPTION: persist = true; break;