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
);
308 skipback_whitespace(start
, end
);
311 remote_argv
[remote_argc
++] = start
;
319 for (method
= 0; remote_methods
[method
].name
; method
++) {
320 unsigned char *name
= remote_methods
[method
].name
;
322 if (!c_strlcasecmp(command
, len
, name
, -1))
326 switch (remote_methods
[method
].type
) {
327 case REMOTE_METHOD_OPENURL
:
328 if (remote_argc
< 1) {
329 /* Prompt for a URL with a dialog box */
330 remote_session_flags
|= SES_REMOTE_PROMPT_URL
;
334 if (remote_argc
== 2) {
335 unsigned char *where
= remote_argv
[1];
337 if (strstr(where
, "new-window")) {
338 remote_session_flags
|= SES_REMOTE_NEW_WINDOW
;
340 } else if (strstr(where
, "new-tab")) {
341 remote_session_flags
|= SES_REMOTE_NEW_TAB
;
344 /* Bail out when getting unknown parameter */
345 /* TODO: new-screen */
350 remote_session_flags
|= SES_REMOTE_CURRENT_TAB
;
353 remote_url
= stracpy(remote_argv
[0]);
356 case REMOTE_METHOD_XFEDOCOMMAND
:
360 if (!c_strcasecmp(remote_argv
[0], "openBrowser")) {
361 remote_session_flags
= SES_REMOTE_NEW_WINDOW
;
365 case REMOTE_METHOD_PING
:
366 remote_session_flags
= SES_REMOTE_PING
;
369 case REMOTE_METHOD_ADDBOOKMARK
:
372 remote_url
= stracpy(remote_argv
[0]);
373 remote_session_flags
= SES_REMOTE_ADD_BOOKMARK
;
376 case REMOTE_METHOD_INFOBOX
:
379 remote_url
= stracpy(remote_argv
[0]);
381 insert_in_string(&remote_url
, 0, "about:", 6);
382 remote_session_flags
= SES_REMOTE_INFO_BOX
;
385 case REMOTE_METHOD_NOT_SUPPORTED
:
391 /* If no flags was applied it can only mean we are dealing with
393 if (!remote_session_flags
)
394 return gettext("Remote method not supported");
396 (*argv
)++; (*argc
)--; /* Consume next argument */
401 static unsigned char *
402 version_cmd(struct option
*o
, unsigned char ***argv
, int *argc
)
404 printf("%s\n", full_static_version
);
410 /* Below we handle help usage printing.
412 * We're trying to achieve several goals here:
414 * - Genericly define a function to print option trees iteratively.
415 * - Make output parsable for various doc tools (to make manpages).
416 * - Do some non generic fancy stuff like printing semi-aliased
417 * options (like: -?, -h and -help) on one line when printing
420 #define gettext_nonempty(x) (*(x) ? gettext(x) : (x))
422 static void print_option_desc(const unsigned char *desc
)
424 struct string wrapped
;
425 static const struct string indent
= INIT_STRING(" ", 12);
427 if (init_string(&wrapped
)
428 && wrap_option_desc(&wrapped
, desc
, &indent
, 79 - indent
.length
)) {
429 /* struct string could in principle contain null
430 * characters, so don't use printf() or fputs(). */
431 fwrite(wrapped
.source
, 1, wrapped
.length
, stdout
);
433 /* Write the error to stderr so it appears on the
434 * screen even if stdout is being parsed by a script
435 * that reformats it to HTML or such. */
436 fprintf(stderr
, "%12s%s\n", "",
437 gettext("Out of memory formatting option documentation"));
440 /* done_string() is safe even if init_string() failed. */
441 done_string(&wrapped
);
444 static void print_full_help_outer(struct option
*tree
, unsigned char *path
);
447 print_full_help_inner(struct option
*tree
, unsigned char *path
,
450 struct option
*option
;
451 unsigned char saved
[MAX_STR_LEN
];
452 unsigned char *savedpos
= saved
;
456 foreach (option
, *tree
->value
.tree
) {
457 enum option_type type
= option
->type
;
459 unsigned char *capt
= option
->capt
;
460 unsigned char *desc
= (option
->desc
&& *option
->desc
)
461 ? (unsigned char *) gettext(option
->desc
)
462 : (unsigned char *) "N/A";
464 if (trees
!= (type
== OPT_TREE
))
467 /* Don't print deprecated aliases (if we don't walk command
468 * line options which use aliases for legitimate options). */
469 if ((type
== OPT_ALIAS
&& tree
!= cmdline_options
)
470 || (option
->flags
& OPT_HIDDEN
))
473 if (!capt
&& !c_strncasecmp(option
->name
, "_template_", 10))
474 capt
= (unsigned char *) N_("Template option folder");
477 int len
= strlen(option
->name
);
478 int max
= MAX_STR_LEN
- (savedpos
- saved
);
480 safe_strncpy(savedpos
, option
->name
, max
);
481 safe_strncpy(savedpos
+ len
, ", -", max
- len
);
486 help
= gettext_nonempty(option_types
[option
->type
].help_str
);
488 if (type
!= OPT_TREE
)
489 printf(" %s%s%s %s ",
490 path
, saved
, option
->name
, help
);
492 /* Print the 'title' of each option type. */
497 printf(gettext("(default: %ld)"),
499 ? option
->value
.big_number
500 : (long) option
->value
.number
);
504 printf(gettext("(default: \"%s\")"),
505 option
->value
.string
);
509 printf(gettext("(alias for %s)"),
510 option
->value
.string
);
514 printf(gettext("(default: %s)"),
515 get_cp_name(option
->value
.number
));
520 color_T color
= option
->value
.color
;
521 unsigned char hexcolor
[8];
523 printf(gettext("(default: %s)"),
524 get_color_string(color
, hexcolor
));
533 printf(gettext("(default: \"%s\")"),
534 language_to_name(option
->value
.number
));
540 int pathlen
= strlen(path
);
541 int namelen
= strlen(option
->name
);
543 if (pathlen
+ namelen
+ 2 > MAX_STR_LEN
)
546 /* Append option name to path */
548 memcpy(saved
, path
, pathlen
);
549 savedpos
= saved
+ pathlen
;
553 memcpy(savedpos
, option
->name
, namelen
+ 1);
556 capt
= gettext_nonempty(capt
);
557 printf(" %s: (%s)", capt
, saved
);
563 print_option_desc(desc
);
566 if (option
->type
== OPT_TREE
) {
567 memcpy(savedpos
, ".", 2);
568 print_full_help_outer(option
, saved
);
577 print_full_help_outer(struct option
*tree
, unsigned char *path
)
579 print_full_help_inner(tree
, path
, 0);
580 print_full_help_inner(tree
, path
, 1);
584 print_short_help(void)
586 #define ALIGN_WIDTH 20
587 struct option
*option
;
588 struct string string
= NULL_STRING
;
589 struct string
*saved
= NULL
;
590 unsigned char align
[ALIGN_WIDTH
];
592 /* Initialize @space used to align captions. */
593 memset(align
, ' ', sizeof(align
) - 1);
594 align
[sizeof(align
) - 1] = 0;
596 foreach (option
, *cmdline_options
->value
.tree
) {
599 unsigned char *info
= saved
? saved
->source
600 : (unsigned char *) "";
601 int len
= strlen(option
->name
);
603 /* Avoid printing compatibility options */
604 if (option
->flags
& OPT_HIDDEN
)
607 /* When no caption is available the option name is 'stacked'
608 * and the caption is shared with next options that has one. */
611 if (!init_string(&string
))
617 add_to_string(saved
, option
->name
);
618 add_to_string(saved
, ", -");
622 capt
= gettext_nonempty(option
->capt
);
623 help
= gettext_nonempty(option_types
[option
->type
].help_str
);
625 /* When @help string is non empty align at least one space. */
626 len
= ALIGN_WIDTH
- len
- strlen(help
);
627 len
-= (saved
? saved
->length
: 0);
628 len
= (len
< 0) ? !!(*help
) : len
;
631 printf(" -%s%s %s%s%s\n",
632 info
, option
->name
, help
, align
, capt
);
642 #undef gettext_nonempty
644 static unsigned char *
645 printhelp_cmd(struct option
*option
, unsigned char ***argv
, int *argc
)
647 unsigned char *lineend
= strchr(full_static_version
, '\n');
649 if (lineend
) *lineend
= '\0';
651 printf("%s\n\n", full_static_version
);
653 if (!strcmp(option
->name
, "config-help")) {
654 printf("%s:\n", gettext("Configuration options"));
655 print_full_help_outer(config_options
, "");
657 printf("%s\n\n%s:\n",
658 gettext("Usage: elinks [OPTION]... [URL]..."),
660 if (!strcmp(option
->name
, "long-help")) {
661 print_full_help_outer(cmdline_options
, "-");
671 static unsigned char *
672 redir_cmd(struct option
*option
, unsigned char ***argv
, int *argc
)
674 unsigned char *target
;
676 /* I can't get any dirtier. --pasky */
678 if (!strcmp(option
->name
, "confdir")) {
679 target
= "config-dir";
680 } else if (!strcmp(option
->name
, "conffile")) {
681 target
= "config-file";
682 } else if (!strcmp(option
->name
, "stdin")) {
683 static int complained
;
689 /* Emulate bool option, possibly eating following 0/1. */
691 && ((*argv
)[0][0] == '0' || (*argv
)[0][0] == '1')
693 (*argv
)++, (*argc
)--;
694 fprintf(stderr
, "Warning: Deprecated option -stdin used!\n");
695 fprintf(stderr
, "ELinks now determines the -stdin option value automatically.\n");
696 fprintf(stderr
, "In the future versions ELinks will report error when you will\n");
697 fprintf(stderr
, "continue to use this option.\a\n");
701 return gettext("Internal consistency error");
704 option
= get_opt_rec(cmdline_options
, target
);
706 option_types
[option
->type
].cmdline(option
, argv
, argc
);
710 static unsigned char *
711 printconfigdump_cmd(struct option
*option
, unsigned char ***argv
, int *argc
)
713 unsigned char *config_string
;
716 get_opt_int("config.saving_style") = 2;
718 config_string
= create_config_string("", "", config_options
);
720 printf("%s", config_string
);
721 mem_free(config_string
);
729 /**********************************************************************
731 **********************************************************************/
733 /* Keep options in alphabetical order. */
735 union option_info cmdline_options_info
[] = {
736 /* [gettext_accelerator_context(IGNORE)] */
737 INIT_OPT_BOOL("", N_("Restrict to anonymous mode"),
739 N_("Restricts ELinks so it can run on an anonymous account. "
740 "Local file browsing, downloads, and modification of options "
741 "will be disabled. Execution of viewers is allowed, but "
742 "entries in the association table can't be added or "
745 INIT_OPT_BOOL("", N_("Autosubmit first form"),
747 N_("Automatically submit the first form in the given URLs.")),
749 INIT_OPT_INT("", N_("Clone internal session with given ID"),
750 "base-session", 0, 0, INT_MAX
, 0,
751 N_("Used internally when opening ELinks instances in new "
752 "windows. The ID maps to information that will be used when "
753 "creating the new instance. You don't want to use it.")),
755 INIT_OPT_COMMAND("", NULL
, "confdir", OPT_HIDDEN
, redir_cmd
, NULL
),
757 INIT_OPT_STRING("", N_("Name of directory with configuration file"),
759 N_("Path of the directory ELinks will read and write its "
760 "config and runtime state files to instead of ~/.elinks. "
761 "If the path does not begin with a '/' it is assumed to be "
762 "relative to your HOME directory.")),
764 INIT_OPT_COMMAND("", N_("Print default configuration file to stdout"),
765 "config-dump", 0, printconfigdump_cmd
,
766 N_("Print a configuration file with options set to the "
767 "built-in defaults to stdout.")),
769 INIT_OPT_COMMAND("", NULL
, "conffile", OPT_HIDDEN
, redir_cmd
, NULL
),
771 INIT_OPT_STRING("", N_("Name of configuration file"),
772 "config-file", 0, "elinks.conf",
773 N_("Name of the configuration file that all configuration "
774 "options will be read from and written to. It should be "
775 "relative to config-dir.")),
777 INIT_OPT_COMMAND("", N_("Print help for configuration options"),
778 "config-help", 0, printhelp_cmd
,
779 N_("Print help for configuration options and exit.")),
781 INIT_OPT_CMDALIAS("", N_("MIME type assumed for unknown document types"),
782 "default-mime-type", 0, "mime.default_type",
783 N_("The default MIME type used for documents of unknown "
786 INIT_OPT_BOOL("", N_("Ignore user-defined keybindings"),
787 "default-keys", 0, 0,
788 N_("When set, all keybindings from configuration files will "
789 "be ignored. It forces use of default keybindings and will "
790 "reset user-defined ones on save.")),
792 INIT_OPT_BOOL("", N_("Print formatted versions of given URLs to stdout"),
794 N_("Print formatted plain-text versions of given URLs to "
797 INIT_OPT_CMDALIAS("", N_("Codepage to use with -dump"),
798 "dump-charset", 0, "document.dump.codepage",
799 N_("Codepage used when formatting dump output.")),
801 INIT_OPT_CMDALIAS("", N_("Color mode used with -dump"),
802 "dump-color-mode", 0, "document.dump.color_mode",
803 N_("Color mode used with -dump.")),
805 INIT_OPT_CMDALIAS("", N_("Width of document formatted with -dump"),
806 "dump-width", 0, "document.dump.width",
807 N_("Width of the dump output.")),
809 INIT_OPT_COMMAND("", N_("Evaluate configuration file directive"),
811 N_("Specify configuration file directives on the command-line "
812 "which will be evaluated after all configuration files has "
813 "been read. Example usage:\n"
814 "\t-eval 'set protocol.file.allow_special_files = 1'")),
816 /* lynx compatibility */
817 INIT_OPT_COMMAND("", N_("Interpret documents of unknown types as HTML"),
818 "force-html", 0, forcehtml_cmd
,
819 N_("Makes ELinks assume documents of unknown types are HTML. "
820 "Useful when using ELinks as an external viewer from MUAs. "
821 "This is equivalent to -default-mime-type text/html.")),
823 /* XXX: -?, -h and -help share the same caption and should be kept in
824 * the current order for usage help printing to be ok */
825 INIT_OPT_COMMAND("", NULL
, "?", 0, printhelp_cmd
, NULL
),
827 INIT_OPT_COMMAND("", NULL
, "h", 0, printhelp_cmd
, NULL
),
829 INIT_OPT_COMMAND("", N_("Print usage help and exit"),
830 "help", 0, printhelp_cmd
,
831 N_("Print usage help and exit.")),
833 INIT_OPT_BOOL("", N_("Only permit local connections"),
835 N_("Restricts ELinks to work offline and only connect to "
836 "servers with local addresses (ie. 127.0.0.1). No connections "
837 "to remote servers will be permitted.")),
839 INIT_OPT_COMMAND("", N_("Print detailed usage help and exit"),
840 "long-help", 0, printhelp_cmd
,
841 N_("Print detailed usage help and exit.")),
843 INIT_OPT_COMMAND("", N_("Look up specified host"),
844 "lookup", 0, lookup_cmd
,
845 N_("Look up specified host and print all DNS resolved IP "
848 INIT_OPT_BOOL("", N_("Run as separate instance"),
850 N_("Run ELinks as a separate instance instead of connecting "
851 "to an existing instance. Note that normally no runtime state "
852 "files (bookmarks, history, etc.) are written to the disk "
853 "when this option is used. See also -touch-files.")),
855 INIT_OPT_BOOL("", N_("Disable use of files in ~/.elinks"),
857 N_("Disables creation and use of files in the user specific "
858 "home configuration directory (~/.elinks). It forces default "
859 "configuration values to be used and disables saving of "
860 "runtime state files.")),
862 INIT_OPT_CMDALIAS("", N_("Disable link numbering in dump output"),
863 "no-numbering", OPT_ALIAS_NEGATE
, "document.dump.numbering",
864 N_("Prevents printing of link number in dump output.\n"
866 "Note that this really affects only -dump, nothing else.")),
868 INIT_OPT_CMDALIAS("", N_("Disable printing of link references in dump output"),
869 "no-references", OPT_ALIAS_NEGATE
, "document.dump.references",
870 N_("Prevents printing of references (URIs) of document links "
873 "Note that this really affects only -dump, nothing else.")),
875 INIT_OPT_COMMAND("", N_("Control an already running ELinks"),
876 "remote", 0, remote_cmd
,
877 N_("Control a remote ELinks instance by passing commands to "
878 "it. The option takes an additional argument containing the "
879 "method which should be invoked and any parameters that "
880 "should be passed to it. For ease of use, the additional "
881 "method argument can be omitted in which case any URL "
882 "arguments will be opened in new tabs in the remote "
885 "Following is a list of the supported methods:\n"
886 "\tping() : look for a remote instance\n"
887 "\topenURL() : prompt URL in current tab\n"
888 "\topenURL(URL) : open URL in current tab\n"
889 "\topenURL(URL, new-tab) : open URL in new tab\n"
890 "\topenURL(URL, new-window) : open URL in new window\n"
891 "\taddBookmark(URL) : bookmark URL\n"
892 "\tinfoBox(text) : show text in a message box\n"
893 "\txfeDoCommand(openBrowser) : open new window")),
895 INIT_OPT_INT("", N_("Connect to session ring with given ID"),
896 "session-ring", 0, 0, INT_MAX
, 0,
897 N_("ID of session ring this ELinks session should connect to. "
898 "ELinks works in so-called session rings, whereby all "
899 "instances of ELinks are interconnected and share state "
900 "(cache, bookmarks, cookies, and so on). By default, all "
901 "ELinks instances connect to session ring 0. You can change "
902 "that behaviour with this switch and form as many session "
903 "rings as you want. Obviously, if the session-ring with this "
904 "number doesn't exist yet, it's created and this ELinks "
905 "instance will become the master instance (that usually "
906 "doesn't matter for you as a user much).\n"
908 "Note that you usually don't want to use this unless you're a "
909 "developer and you want to do some testing - if you want the "
910 "ELinks instances each running standalone, rather use the "
911 "-no-connect command-line option. Also note that normally no "
912 "runtime state files are written to the disk when this option "
913 "is used. See also -touch-files.")),
915 INIT_OPT_BOOL("", N_("Print the source of given URLs to stdout"),
917 N_("Print given URLs in source form to stdout.")),
919 INIT_OPT_COMMAND("", NULL
, "stdin", OPT_HIDDEN
, redir_cmd
, NULL
),
921 INIT_OPT_BOOL("", N_("Touch files in ~/.elinks when running with -no-connect/-session-ring"),
923 N_("When enabled, runtime state files (bookmarks, history, "
924 "etc.) are written to disk, even when -no-connect or "
925 "-session-ring is used. The option has no effect if not used "
926 "in conjunction with any of these options.")),
928 INIT_OPT_INT("", N_("Verbose level"),
929 "verbose", 0, 0, VERBOSE_LEVELS
- 1, VERBOSE_WARNINGS
,
930 N_("The verbose level controls what messages are shown at "
931 "start up and while running:\n"
932 "\t0 means only show serious errors\n"
933 "\t1 means show serious errors and warnings\n"
934 "\t2 means show all messages")),
936 INIT_OPT_COMMAND("", N_("Print version information and exit"),
937 "version", 0, version_cmd
,
938 N_("Print ELinks version information and exit.")),