1 /* Command line processing */
10 #ifdef HAVE_SYS_SOCKET_H
11 #include <sys/socket.h> /* OS/2 needs this after sys/types.h */
13 #include <sys/stat.h> /* OS/2 needs this after sys/types.h */
18 /* We need to have it here. Stupid BSD. */
19 #ifdef HAVE_NETINET_IN_H
20 #include <netinet/in.h>
22 #ifdef HAVE_ARPA_INET_H
23 #include <arpa/inet.h>
28 #include "config/cmdline.h"
29 #include "config/conf.h"
30 #include "config/options.h"
31 #include "config/opttypes.h"
32 #include "intl/gettext/libintl.h"
33 #include "network/dns.h"
34 #include "protocol/uri.h"
35 #include "session/session.h"
36 #include "util/error.h"
37 #include "util/file.h"
38 #include "util/lists.h"
39 #include "util/memory.h"
40 #include "util/string.h"
43 /* Hack to handle URL extraction for -remote commands */
44 static unsigned char *remote_url
;
47 parse_options_(int argc
, unsigned char *argv
[], struct option
*opt
,
48 LIST_OF(struct string_list_item
) *url_list
)
53 if (argv
[-1][0] == '-' && argv
[-1][1]) {
54 struct option
*option
;
55 unsigned char *argname
= &argv
[-1][1];
56 unsigned char *oname
= stracpy(argname
);
61 /* Treat --foo same as -foo. */
62 if (argname
[0] == '-') argname
++;
64 option
= get_opt_rec(opt
, argname
);
65 if (!option
) option
= get_opt_rec(opt
, oname
);
69 oname
++; /* the '-' */
70 /* Substitute '-' by '_'. This helps
71 * compatibility with that very wicked browser
73 for (pos
= strchr(oname
, '_'); pos
;
74 pos
= strchr(pos
, '_'))
76 option
= get_opt_rec(opt
, oname
);
82 if (!option
) goto unknown_option
;
84 if (!option_types
[option
->type
].cmdline
)
87 err
= option_types
[option
->type
].cmdline(option
, &argv
, &argc
);
91 usrerror(gettext("Cannot parse option %s: %s"), argv
[-1], err
);
96 /* XXX: Empty strings means all is well and have
97 * a cup of shut the fsck up. */
100 } else if (remote_url
) {
101 if (url_list
) add_to_string_list(url_list
, remote_url
, -1);
102 mem_free(remote_url
);
106 } else if (url_list
) {
107 add_to_string_list(url_list
, argv
[-1], -1);
114 usrerror(gettext("Unknown option %s"), argv
[-1]);
119 parse_options(int argc
, unsigned char *argv
[],
120 LIST_OF(struct string_list_item
) *url_list
)
122 return parse_options_(argc
, argv
, cmdline_options
, url_list
);
126 /**********************************************************************
128 **********************************************************************/
130 static unsigned char *
131 eval_cmd(struct option
*o
, unsigned char ***argv
, int *argc
)
133 if (*argc
< 1) return gettext("Parameter expected");
135 (*argv
)++; (*argc
)--; /* Consume next argument */
137 parse_config_file(config_options
, "-eval", *(*argv
- 1), NULL
, 0);
144 static unsigned char *
145 forcehtml_cmd(struct option
*o
, unsigned char ***argv
, int *argc
)
147 safe_strncpy(get_opt_str("mime.default_type"), "text/html", MAX_STR_LEN
);
151 static unsigned char *
152 lookup_cmd(struct option
*o
, unsigned char ***argv
, int *argc
)
154 struct sockaddr_storage
*addrs
= NULL
;
157 if (!*argc
) return gettext("Parameter expected");
158 if (*argc
> 1) return gettext("Too many parameters");
160 (*argv
)++; (*argc
)--;
161 if (do_real_lookup(*(*argv
- 1), &addrs
, &addrno
, 0) == DNS_ERROR
) {
163 herror(gettext("error"));
165 usrerror(gettext("Host not found"));
170 for (i
= 0; i
< addrno
; i
++) {
172 struct sockaddr_in6 addr
= *((struct sockaddr_in6
*) &(addrs
)[i
]);
173 unsigned char p
[INET6_ADDRSTRLEN
];
175 if (! inet_ntop(addr
.sin6_family
,
176 (addr
.sin6_family
== AF_INET6
? (void *) &addr
.sin6_addr
177 : (void *) &((struct sockaddr_in
*) &addr
)->sin_addr
),
178 p
, INET6_ADDRSTRLEN
))
179 ERROR(gettext("Resolver error"));
183 struct sockaddr_in addr
= *((struct sockaddr_in
*) &(addrs
)[i
]);
184 unsigned char *p
= (unsigned char *) &addr
.sin_addr
.s_addr
;
186 printf("%d.%d.%d.%d\n", (int) p
[0], (int) p
[1],
187 (int) p
[2], (int) p
[3]);
198 #define skipback_whitespace(start, S) \
199 while ((start) < (S) && isspace((S)[-1])) (S)--;
201 static unsigned char *
202 remote_cmd(struct option
*o
, unsigned char ***argv
, int *argc
)
207 REMOTE_METHOD_OPENURL
,
209 REMOTE_METHOD_XFEDOCOMMAND
,
210 REMOTE_METHOD_ADDBOOKMARK
,
211 REMOTE_METHOD_INFOBOX
,
212 REMOTE_METHOD_NOT_SUPPORTED
,
214 } remote_methods
[] = {
215 { "openURL", REMOTE_METHOD_OPENURL
},
216 { "ping", REMOTE_METHOD_PING
},
217 { "addBookmark", REMOTE_METHOD_ADDBOOKMARK
},
218 { "infoBox", REMOTE_METHOD_INFOBOX
},
219 { "xfeDoCommand", REMOTE_METHOD_XFEDOCOMMAND
},
220 { NULL
, REMOTE_METHOD_NOT_SUPPORTED
},
222 unsigned char *command
, *arg
, *argend
, *argstring
;
224 unsigned char *remote_argv
[10];
227 if (*argc
< 1) return gettext("Parameter expected");
231 while (isasciialpha(command
[len
]))
234 /* Find the begining and end of the argument list. */
239 argend
= arg
+ strlen(arg
);
240 skipback_whitespace(arg
, argend
);
244 /* Decide whether to use the "extended" --remote format where
245 * all URLs following should be opened in tabs. */
246 if (len
== 0 || *arg
!= '(' || *argend
!= ')') {
247 /* Just open any passed URLs in new tabs */
248 remote_session_flags
|= SES_REMOTE_NEW_TAB
;
254 arg
= argstring
= memacpy(arg
, argend
- arg
);
256 return gettext("Out of memory");
260 unsigned char *start
, *end
;
262 if (remote_argc
> sizeof_array(remote_argv
)) {
264 return gettext("Too many arguments");
267 /* Skip parenthesis, comma, and surrounding whitespace. */
273 while ((end
= strchr(end
, '"'))) {
274 /* Treat "" inside quoted arg as ". */
282 return gettext("Mismatched ending argument quoting");
286 if (*arg
&& *arg
!= ',')
287 return gettext("Garbage after quoted argument");
289 remote_argv
[remote_argc
++] = start
;
292 /* Unescape "" to ". */
293 for (end
= start
; *end
; start
++, end
++) {
301 end
= strchr(start
, ',');
303 end
= start
+ strlen(start
);
305 skipback_whitespace(start
, end
);
308 remote_argv
[remote_argc
++] = start
;
316 for (method
= 0; remote_methods
[method
].name
; method
++) {
317 unsigned char *name
= remote_methods
[method
].name
;
319 if (!strlcasecmp(command
, len
, name
, -1))
323 switch (remote_methods
[method
].type
) {
324 case REMOTE_METHOD_OPENURL
:
325 if (remote_argc
< 1) {
326 /* Prompt for a URL with a dialog box */
327 remote_session_flags
|= SES_REMOTE_PROMPT_URL
;
331 if (remote_argc
== 2) {
332 unsigned char *where
= remote_argv
[1];
334 if (strstr(where
, "new-window")) {
335 remote_session_flags
|= SES_REMOTE_NEW_WINDOW
;
337 } else if (strstr(where
, "new-tab")) {
338 remote_session_flags
|= SES_REMOTE_NEW_TAB
;
341 /* Bail out when getting unknown parameter */
342 /* TODO: new-screen */
347 remote_session_flags
|= SES_REMOTE_CURRENT_TAB
;
350 remote_url
= stracpy(remote_argv
[0]);
353 case REMOTE_METHOD_XFEDOCOMMAND
:
357 if (!strcasecmp(remote_argv
[0], "openBrowser")) {
358 remote_session_flags
= SES_REMOTE_NEW_WINDOW
;
362 case REMOTE_METHOD_PING
:
363 remote_session_flags
= SES_REMOTE_PING
;
366 case REMOTE_METHOD_ADDBOOKMARK
:
369 remote_url
= stracpy(remote_argv
[0]);
370 remote_session_flags
= SES_REMOTE_ADD_BOOKMARK
;
373 case REMOTE_METHOD_INFOBOX
:
376 remote_url
= stracpy(remote_argv
[0]);
378 insert_in_string(&remote_url
, 0, "about:", 6);
379 remote_session_flags
= SES_REMOTE_INFO_BOX
;
382 case REMOTE_METHOD_NOT_SUPPORTED
:
388 /* If no flags was applied it can only mean we are dealing with
390 if (!remote_session_flags
)
391 return gettext("Remote method not supported");
393 (*argv
)++; (*argc
)--; /* Consume next argument */
398 static unsigned char *
399 version_cmd(struct option
*o
, unsigned char ***argv
, int *argc
)
401 printf("%s\n", full_static_version
);
407 /* Below we handle help usage printing.
409 * We're trying to achieve several goals here:
411 * - Genericly define a function to print option trees iteratively.
412 * - Make output parsable for various doc tools (to make manpages).
413 * - Do some non generic fancy stuff like printing semi-aliased
414 * options (like: -?, -h and -help) on one line when printing
417 #define gettext_nonempty(x) (*(x) ? gettext(x) : (x))
420 print_full_help(struct option
*tree
, unsigned char *path
)
422 struct option
*option
;
423 unsigned char saved
[MAX_STR_LEN
];
424 unsigned char *savedpos
= saved
;
428 foreach (option
, *tree
->value
.tree
) {
429 enum option_type type
= option
->type
;
431 unsigned char *capt
= option
->capt
;
432 unsigned char *desc
= (option
->desc
&& *option
->desc
)
433 ? (unsigned char *) gettext(option
->desc
)
434 : (unsigned char *) "N/A";
436 /* Don't print deprecated aliases (if we don't walk command
437 * line options which use aliases for legitimate options). */
438 if ((type
== OPT_ALIAS
&& tree
!= cmdline_options
)
439 || (option
->flags
& OPT_HIDDEN
))
442 if (!capt
&& !strncasecmp(option
->name
, "_template_", 10))
443 capt
= (unsigned char *) N_("Template option folder");
446 int len
= strlen(option
->name
);
447 int max
= MAX_STR_LEN
- (savedpos
- saved
);
449 safe_strncpy(savedpos
, option
->name
, max
);
450 safe_strncpy(savedpos
+ len
, ", -", max
- len
);
455 help
= gettext_nonempty(option_types
[option
->type
].help_str
);
457 if (type
!= OPT_TREE
)
458 printf(" %s%s%s %s ",
459 path
, saved
, option
->name
, help
);
461 /* Print the 'title' of each option type. */
466 printf(gettext("(default: %ld)"),
468 ? option
->value
.big_number
469 : (long) option
->value
.number
);
473 printf(gettext("(default: \"%s\")"),
474 option
->value
.string
);
478 printf(gettext("(alias for %s)"),
479 option
->value
.string
);
483 printf(gettext("(default: %s)"),
484 get_cp_name(option
->value
.number
));
489 color_T color
= option
->value
.color
;
490 unsigned char hexcolor
[8];
492 printf(gettext("(default: %s)"),
493 get_color_string(color
, hexcolor
));
502 printf(gettext("(default: \"%s\")"),
503 language_to_name(option
->value
.number
));
509 int pathlen
= strlen(path
);
510 int namelen
= strlen(option
->name
);
512 if (pathlen
+ namelen
+ 2 > MAX_STR_LEN
)
515 /* Append option name to path */
517 memcpy(saved
, path
, pathlen
);
518 savedpos
= saved
+ pathlen
;
522 memcpy(savedpos
, option
->name
, namelen
+ 1);
525 capt
= gettext_nonempty(capt
);
526 printf(" %s: (%s)", capt
, saved
);
531 printf("\n %8s", "");
533 int l
= strlen(desc
);
536 for (i
= 0; i
< l
; i
++) {
545 if (option
->type
== OPT_TREE
) {
546 memcpy(savedpos
, ".", 2);
547 print_full_help(option
, saved
);
556 print_short_help(void)
558 #define ALIGN_WIDTH 20
559 struct option
*option
;
560 struct string string
= NULL_STRING
;
561 struct string
*saved
= NULL
;
562 unsigned char align
[ALIGN_WIDTH
];
564 /* Initialize @space used to align captions. */
565 memset(align
, ' ', sizeof(align
) - 1);
566 align
[sizeof(align
) - 1] = 0;
568 foreach (option
, *cmdline_options
->value
.tree
) {
571 unsigned char *info
= saved
? saved
->source
572 : (unsigned char *) "";
573 int len
= strlen(option
->name
);
575 /* Avoid printing compatibility options */
576 if (option
->flags
& OPT_HIDDEN
)
579 /* When no caption is available the option name is 'stacked'
580 * and the caption is shared with next options that has one. */
583 if (!init_string(&string
))
589 add_to_string(saved
, option
->name
);
590 add_to_string(saved
, ", -");
594 capt
= gettext_nonempty(option
->capt
);
595 help
= gettext_nonempty(option_types
[option
->type
].help_str
);
597 /* When @help string is non empty align at least one space. */
598 len
= ALIGN_WIDTH
- len
- strlen(help
);
599 len
-= (saved
? saved
->length
: 0);
600 len
= (len
< 0) ? !!(*help
) : len
;
603 printf(" -%s%s %s%s%s\n",
604 info
, option
->name
, help
, align
, capt
);
614 #undef gettext_nonempty
616 static unsigned char *
617 printhelp_cmd(struct option
*option
, unsigned char ***argv
, int *argc
)
619 unsigned char *lineend
= strchr(full_static_version
, '\n');
621 if (lineend
) *lineend
= '\0';
623 printf("%s\n\n", full_static_version
);
625 if (!strcmp(option
->name
, "config-help")) {
626 printf("%s:\n", gettext("Configuration options"));
627 print_full_help(config_options
, "");
629 printf("%s\n\n%s:\n",
630 gettext("Usage: elinks [OPTION]... [URL]..."),
632 if (!strcmp(option
->name
, "long-help")) {
633 print_full_help(cmdline_options
, "-");
643 static unsigned char *
644 redir_cmd(struct option
*option
, unsigned char ***argv
, int *argc
)
646 unsigned char *target
;
648 /* I can't get any dirtier. --pasky */
650 if (!strcmp(option
->name
, "confdir")) {
651 target
= "config-dir";
652 } else if (!strcmp(option
->name
, "conffile")) {
653 target
= "config-file";
654 } else if (!strcmp(option
->name
, "stdin")) {
655 static int complained
;
661 /* Emulate bool option, possibly eating following 0/1. */
663 && ((*argv
)[0][0] == '0' || (*argv
)[0][0] == '1')
665 (*argv
)++, (*argc
)--;
666 fprintf(stderr
, "Warning: Deprecated option -stdin used!\n");
667 fprintf(stderr
, "ELinks now determines the -stdin option value automatically.\n");
668 fprintf(stderr
, "In the future versions ELinks will report error when you will\n");
669 fprintf(stderr
, "continue to use this option.\a\n");
673 return gettext("Internal consistency error");
676 option
= get_opt_rec(cmdline_options
, target
);
678 option_types
[option
->type
].cmdline(option
, argv
, argc
);
682 static unsigned char *
683 printconfigdump_cmd(struct option
*option
, unsigned char ***argv
, int *argc
)
685 unsigned char *config_string
;
688 get_opt_int("config.saving_style") = 2;
690 config_string
= create_config_string("", "", config_options
);
692 printf("%s", config_string
);
693 mem_free(config_string
);
701 /**********************************************************************
703 **********************************************************************/
705 /* Keep options in alphabetical order. */
707 struct option_info cmdline_options_info
[] = {
708 /* [gettext_accelerator_context(IGNORE)] */
709 INIT_OPT_BOOL("", N_("Restrict to anonymous mode"),
711 N_("Restricts ELinks so it can run on an anonymous account.\n"
712 "Local file browsing, downloads, and modification of options\n"
713 "will be disabled. Execution of viewers is allowed, but entries\n"
714 "in the association table can't be added or modified.")),
716 INIT_OPT_BOOL("", N_("Autosubmit first form"),
718 N_("Automatically submit the first form in the given URLs.")),
720 INIT_OPT_INT("", N_("Clone internal session with given ID"),
721 "base-session", 0, 0, INT_MAX
, 0,
722 N_("Used internally when opening ELinks instances in new windows.\n"
723 "The ID maps to information that will be used when creating the\n"
724 "new instance. You don't want to use it.")),
726 INIT_OPT_COMMAND("", NULL
, "confdir", OPT_HIDDEN
, redir_cmd
, NULL
),
728 INIT_OPT_STRING("", N_("Name of directory with configuration file"),
730 N_("Path of the directory ELinks will read and write its\n"
731 "config and runtime state files to instead of ~/.elinks.\n"
732 "If the path does not begin with a '/' it is assumed to be\n"
733 "relative to your HOME directory.")),
735 INIT_OPT_COMMAND("", N_("Print default configuration file to stdout"),
736 "config-dump", 0, printconfigdump_cmd
,
737 N_("Print a configuration file with options set to the built-in\n"
738 "defaults to stdout.")),
740 INIT_OPT_COMMAND("", NULL
, "conffile", OPT_HIDDEN
, redir_cmd
, NULL
),
742 INIT_OPT_STRING("", N_("Name of configuration file"),
743 "config-file", 0, "elinks.conf",
744 N_("Name of the configuration file that all configuration\n"
745 "options will be read from and written to. It should be\n"
746 "relative to config-dir.")),
748 INIT_OPT_COMMAND("", N_("Print help for configuration options"),
749 "config-help", 0, printhelp_cmd
,
750 N_("Print help for configuration options and exit.")),
752 INIT_OPT_CMDALIAS("", N_("MIME type assumed for unknown document types"),
753 "default-mime-type", 0, "mime.default_type",
754 N_("The default MIME type used for documents of unknown type.")),
756 INIT_OPT_BOOL("", N_("Ignore user-defined keybindings"),
757 "default-keys", 0, 0,
758 N_("When set, all keybindings from configuration files will be\n"
759 "ignored. It forces use of default keybindings and will reset\n"
760 "user-defined ones on save.")),
762 INIT_OPT_BOOL("", N_("Print formatted versions of given URLs to stdout"),
764 N_("Print formatted plain-text versions of given URLs to stdout.")),
766 INIT_OPT_CMDALIAS("", N_("Codepage to use with -dump"),
767 "dump-charset", 0, "document.dump.codepage",
768 N_("Codepage used when formatting dump output.")),
770 INIT_OPT_CMDALIAS("", N_("Color mode used with -dump"),
771 "dump-color-mode", 0, "document.dump.color_mode",
772 N_("Color mode used with -dump.")),
774 INIT_OPT_CMDALIAS("", N_("Width of document formatted with -dump"),
775 "dump-width", 0, "document.dump.width",
776 N_("Width of the dump output.")),
778 INIT_OPT_COMMAND("", N_("Evaluate configuration file directive"),
780 N_("Specify configuration file directives on the command-line\n"
781 "which will be evaluated after all configuration files has been\n"
782 "read. Example usage:\n"
783 "\t-eval 'set protocol.file.allow_special_files = 1'")),
785 /* lynx compatibility */
786 INIT_OPT_COMMAND("", N_("Interpret documents of unknown types as HTML"),
787 "force-html", 0, forcehtml_cmd
,
788 N_("Makes ELinks assume documents of unknown types are HTML.\n"
789 "Useful when using ELinks as an external viewer from MUAs.\n"
790 "This is equivalent to -default-mime-type text/html.")),
792 /* XXX: -?, -h and -help share the same caption and should be kept in
793 * the current order for usage help printing to be ok */
794 INIT_OPT_COMMAND("", NULL
, "?", 0, printhelp_cmd
, NULL
),
796 INIT_OPT_COMMAND("", NULL
, "h", 0, printhelp_cmd
, NULL
),
798 INIT_OPT_COMMAND("", N_("Print usage help and exit"),
799 "help", 0, printhelp_cmd
,
800 N_("Print usage help and exit.")),
802 INIT_OPT_BOOL("", N_("Only permit local connections"),
804 N_("Restricts ELinks to work offline and only connect to servers\n"
805 "with local addresses (ie. 127.0.0.1). No connections to remote\n"
806 "servers will be permitted.")),
808 INIT_OPT_COMMAND("", N_("Print detailed usage help and exit"),
809 "long-help", 0, printhelp_cmd
,
810 N_("Print detailed usage help and exit.")),
812 INIT_OPT_COMMAND("", N_("Look up specified host"),
813 "lookup", 0, lookup_cmd
,
814 N_("Look up specified host and print all DNS resolved IP addresses.")),
816 INIT_OPT_BOOL("", N_("Run as separate instance"),
818 N_("Run ELinks as a separate instance instead of connecting to an\n"
819 "existing instance. Note that normally no runtime state files\n"
820 "(bookmarks, history, etc.) are written to the disk when this\n"
821 "option is used. See also -touch-files.")),
823 INIT_OPT_BOOL("", N_("Disable use of files in ~/.elinks"),
825 N_("Disables creation and use of files in the user specific home\n"
826 "configuration directory (~/.elinks). It forces default configuration\n"
827 "values to be used and disables saving of runtime state files.")),
829 INIT_OPT_CMDALIAS("", N_("Disable link numbering in dump output"),
830 "no-numbering", OPT_ALIAS_NEGATE
, "document.dump.numbering",
831 N_("Prevents printing of link number in dump output.\n"
832 "Note that this really affects only -dump, nothing else.")),
834 INIT_OPT_CMDALIAS("", N_("Disable printing of link references in dump output"),
835 "no-references", OPT_ALIAS_NEGATE
, "document.dump.references",
836 N_("Prevents printing of references (URIs) of document links\n"
838 "Note that this really affects only -dump, nothing else.")),
840 INIT_OPT_COMMAND("", N_("Control an already running ELinks"),
841 "remote", 0, remote_cmd
,
842 N_("Control a remote ELinks instance by passing commands to it.\n"
843 "The option takes an additional argument containing the method\n"
844 "which should be invoked and any parameters that should be passed\n"
845 "to it. For ease of use, the additional method argument can be\n"
846 "omitted in which case any URL arguments will be opened in new\n"
847 "tabs in the remote instance.\n"
848 "Following is a list of the supported methods:\n"
849 "\tping() : look for a remote instance\n"
850 "\topenURL() : prompt URL in current tab\n"
851 "\topenURL(URL) : open URL in current tab\n"
852 "\topenURL(URL, new-tab) : open URL in new tab\n"
853 "\topenURL(URL, new-window) : open URL in new window\n"
854 "\taddBookmark(URL) : bookmark URL\n"
855 "\tinfoBox(text) : show text in a message box\n"
856 "\txfeDoCommand(openBrowser) : open new window")),
858 INIT_OPT_INT("", N_("Connect to session ring with given ID"),
859 "session-ring", 0, 0, INT_MAX
, 0,
860 N_("ID of session ring this ELinks session should connect to. ELinks\n"
861 "works in so-called session rings, whereby all instances of ELinks\n"
862 "are interconnected and share state (cache, bookmarks, cookies,\n"
863 "and so on). By default, all ELinks instances connect to session\n"
864 "ring 0. You can change that behaviour with this switch and form as\n"
865 "many session rings as you want. Obviously, if the session-ring with\n"
866 "this number doesn't exist yet, it's created and this ELinks instance\n"
867 "will become the master instance (that usually doesn't matter for you\n"
868 "as a user much). Note that you usually don't want to use this unless\n"
869 "you're a developer and you want to do some testing - if you want the\n"
870 "ELinks instances each running standalone, rather use the -no-connect\n"
871 "command-line option. Also note that normally no runtime state files\n"
872 "are written to the disk when this option is used. See also\n"
875 INIT_OPT_BOOL("", N_("Print the source of given URLs to stdout"),
877 N_("Print given URLs in source form to stdout.")),
879 INIT_OPT_COMMAND("", NULL
, "stdin", OPT_HIDDEN
, redir_cmd
, NULL
),
881 INIT_OPT_BOOL("", N_("Touch files in ~/.elinks when running with -no-connect/-session-ring"),
883 N_("When enabled, runtime state files (bookmarks, history, etc.) are\n"
884 "written to disk, even when -no-connect or -session-ring is used.\n"
885 "The option has no effect if not used in conjunction with any of\n"
888 INIT_OPT_INT("", N_("Verbose level"),
889 "verbose", 0, 0, VERBOSE_LEVELS
- 1, VERBOSE_WARNINGS
,
890 N_("The verbose level controls what messages are shown at\n"
891 "start up and while running:\n"
892 "\t0 means only show serious errors\n"
893 "\t1 means show serious errors and warnings\n"
894 "\t2 means show all messages")),
896 INIT_OPT_COMMAND("", N_("Print version information and exit"),
897 "version", 0, version_cmd
,
898 N_("Print ELinks version information and exit.")),