2005-09-15 09:58:31 -04:00
|
|
|
/* Command line processing */
|
|
|
|
|
|
|
|
#ifdef HAVE_CONFIG_H
|
|
|
|
#include "config.h"
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include <stdio.h>
|
2021-04-28 10:10:59 -04:00
|
|
|
#include <stdlib.h>
|
2005-09-15 09:58:31 -04:00
|
|
|
#include <string.h>
|
|
|
|
#include <sys/types.h>
|
|
|
|
#ifdef HAVE_SYS_SOCKET_H
|
|
|
|
#include <sys/socket.h> /* OS/2 needs this after sys/types.h */
|
|
|
|
#endif
|
|
|
|
#include <sys/stat.h> /* OS/2 needs this after sys/types.h */
|
|
|
|
#ifdef HAVE_NETDB_H
|
|
|
|
#include <netdb.h>
|
|
|
|
#endif
|
|
|
|
|
2021-04-28 10:10:59 -04:00
|
|
|
#ifdef HAVE_IDNA_H
|
|
|
|
#include <idna.h>
|
|
|
|
#endif
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
/* We need to have it here. Stupid BSD. */
|
|
|
|
#ifdef HAVE_NETINET_IN_H
|
|
|
|
#include <netinet/in.h>
|
|
|
|
#endif
|
|
|
|
#ifdef HAVE_ARPA_INET_H
|
|
|
|
#include <arpa/inet.h>
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "elinks.h"
|
|
|
|
|
|
|
|
#include "config/cmdline.h"
|
|
|
|
#include "config/conf.h"
|
|
|
|
#include "config/options.h"
|
|
|
|
#include "config/opttypes.h"
|
2021-08-08 15:25:08 -04:00
|
|
|
#include "intl/libintl.h"
|
2005-09-15 09:58:31 -04:00
|
|
|
#include "network/dns.h"
|
|
|
|
#include "protocol/uri.h"
|
|
|
|
#include "session/session.h"
|
|
|
|
#include "util/error.h"
|
|
|
|
#include "util/file.h"
|
|
|
|
#include "util/lists.h"
|
|
|
|
#include "util/memory.h"
|
|
|
|
#include "util/string.h"
|
|
|
|
|
|
|
|
|
|
|
|
/* Hack to handle URL extraction for -remote commands */
|
2021-01-02 10:20:27 -05:00
|
|
|
static char *remote_url;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
static enum retval
|
2021-01-02 10:20:27 -05:00
|
|
|
parse_options_(int argc, char *argv[], struct option *opt,
|
2007-07-26 15:39:08 -04:00
|
|
|
LIST_OF(struct string_list_item) *url_list)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
|
|
|
while (argc) {
|
|
|
|
argv++, argc--;
|
|
|
|
|
|
|
|
if (argv[-1][0] == '-' && argv[-1][1]) {
|
|
|
|
struct option *option;
|
2021-01-02 10:20:27 -05:00
|
|
|
char *argname = &argv[-1][1];
|
|
|
|
char *oname = stracpy(argname);
|
|
|
|
char *err;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
if (!oname) continue;
|
|
|
|
|
|
|
|
/* Treat --foo same as -foo. */
|
|
|
|
if (argname[0] == '-') argname++;
|
|
|
|
|
|
|
|
option = get_opt_rec(opt, argname);
|
|
|
|
if (!option) option = get_opt_rec(opt, oname);
|
|
|
|
if (!option) {
|
2021-01-02 10:20:27 -05:00
|
|
|
char *pos;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
oname++; /* the '-' */
|
|
|
|
/* Substitute '-' by '_'. This helps
|
|
|
|
* compatibility with that very wicked browser
|
|
|
|
* called 'lynx'. */
|
2022-01-18 14:30:48 -05:00
|
|
|
for (pos = strchr(oname, '_'); pos;
|
|
|
|
pos = strchr(pos, '_'))
|
2005-09-15 09:58:31 -04:00
|
|
|
*pos = '-';
|
|
|
|
option = get_opt_rec(opt, oname);
|
|
|
|
oname--;
|
|
|
|
}
|
|
|
|
|
|
|
|
mem_free(oname);
|
|
|
|
|
|
|
|
if (!option) goto unknown_option;
|
|
|
|
|
|
|
|
if (!option_types[option->type].cmdline)
|
|
|
|
goto unknown_option;
|
|
|
|
|
|
|
|
err = option_types[option->type].cmdline(option, &argv, &argc);
|
|
|
|
|
|
|
|
if (err) {
|
|
|
|
if (err[0]) {
|
|
|
|
usrerror(gettext("Cannot parse option %s: %s"), argv[-1], err);
|
|
|
|
|
|
|
|
return RET_SYNTAX;
|
|
|
|
}
|
|
|
|
|
|
|
|
/* XXX: Empty strings means all is well and have
|
|
|
|
* a cup of shut the fsck up. */
|
|
|
|
return RET_COMMAND;
|
|
|
|
|
|
|
|
} else if (remote_url) {
|
|
|
|
if (url_list) add_to_string_list(url_list, remote_url, -1);
|
|
|
|
mem_free(remote_url);
|
|
|
|
remote_url = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else if (url_list) {
|
|
|
|
add_to_string_list(url_list, argv[-1], -1);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return RET_OK;
|
|
|
|
|
|
|
|
unknown_option:
|
|
|
|
usrerror(gettext("Unknown option %s"), argv[-1]);
|
|
|
|
return RET_SYNTAX;
|
|
|
|
}
|
|
|
|
|
|
|
|
enum retval
|
2021-01-02 10:20:27 -05:00
|
|
|
parse_options(int argc, char *argv[],
|
2007-07-26 15:39:08 -04:00
|
|
|
LIST_OF(struct string_list_item) *url_list)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
|
|
|
return parse_options_(argc, argv, cmdline_options, url_list);
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
Options handlers
|
|
|
|
**********************************************************************/
|
|
|
|
|
2021-01-02 10:20:27 -05:00
|
|
|
static char *
|
|
|
|
eval_cmd(struct option *o, char ***argv, int *argc)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
|
|
|
if (*argc < 1) return gettext("Parameter expected");
|
|
|
|
|
|
|
|
(*argv)++; (*argc)--; /* Consume next argument */
|
|
|
|
|
|
|
|
parse_config_file(config_options, "-eval", *(*argv - 1), NULL, 0);
|
|
|
|
|
|
|
|
fflush(stdout);
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2021-01-02 10:20:27 -05:00
|
|
|
static char *
|
|
|
|
forcehtml_cmd(struct option *o, char ***argv, int *argc)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
2007-08-28 12:41:18 -04:00
|
|
|
safe_strncpy(get_opt_str("mime.default_type", NULL), "text/html", MAX_STR_LEN);
|
2005-09-15 09:58:31 -04:00
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2021-01-02 10:20:27 -05:00
|
|
|
static char *
|
|
|
|
lookup_cmd(struct option *o, char ***argv, int *argc)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
|
|
|
struct sockaddr_storage *addrs = NULL;
|
|
|
|
int addrno, i;
|
2021-04-28 10:10:59 -04:00
|
|
|
char *idname, *idname2;
|
|
|
|
int allocated = 0;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
if (!*argc) return gettext("Parameter expected");
|
|
|
|
if (*argc > 1) return gettext("Too many parameters");
|
|
|
|
|
|
|
|
(*argv)++; (*argc)--;
|
2021-04-28 10:10:59 -04:00
|
|
|
|
|
|
|
idname = *(*argv - 1);
|
|
|
|
|
|
|
|
#ifdef CONFIG_IDN
|
|
|
|
if (idname) {
|
|
|
|
int code = idna_to_ascii_lz(idname, &idname2, 0);
|
|
|
|
|
|
|
|
if (code == IDNA_SUCCESS) {
|
|
|
|
idname = idname2;
|
|
|
|
allocated = 1;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#endif
|
|
|
|
|
|
|
|
if (do_real_lookup(idname, &addrs, &addrno, 0) == DNS_ERROR) {
|
2005-09-15 09:58:31 -04:00
|
|
|
#ifdef HAVE_HERROR
|
|
|
|
herror(gettext("error"));
|
|
|
|
#else
|
|
|
|
usrerror(gettext("Host not found"));
|
|
|
|
#endif
|
2021-04-28 10:10:59 -04:00
|
|
|
if (allocated) {
|
|
|
|
free(idname2);
|
|
|
|
}
|
2005-09-15 09:58:31 -04:00
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
for (i = 0; i < addrno; i++) {
|
|
|
|
#ifdef CONFIG_IPV6
|
|
|
|
struct sockaddr_in6 addr = *((struct sockaddr_in6 *) &(addrs)[i]);
|
2021-01-02 10:20:27 -05:00
|
|
|
char p[INET6_ADDRSTRLEN];
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
if (! inet_ntop(addr.sin6_family,
|
|
|
|
(addr.sin6_family == AF_INET6 ? (void *) &addr.sin6_addr
|
|
|
|
: (void *) &((struct sockaddr_in *) &addr)->sin_addr),
|
|
|
|
p, INET6_ADDRSTRLEN))
|
|
|
|
ERROR(gettext("Resolver error"));
|
|
|
|
else
|
|
|
|
printf("%s\n", p);
|
|
|
|
#else
|
|
|
|
struct sockaddr_in addr = *((struct sockaddr_in *) &(addrs)[i]);
|
2021-01-02 10:20:27 -05:00
|
|
|
char *p = (char *) &addr.sin_addr.s_addr;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
printf("%d.%d.%d.%d\n", (int) p[0], (int) p[1],
|
|
|
|
(int) p[2], (int) p[3]);
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
mem_free_if(addrs);
|
|
|
|
|
|
|
|
fflush(stdout);
|
|
|
|
|
2021-04-28 10:10:59 -04:00
|
|
|
if (allocated) {
|
|
|
|
free(idname2);
|
|
|
|
}
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
#define skipback_whitespace(start, S) \
|
|
|
|
while ((start) < (S) && isspace((S)[-1])) (S)--;
|
|
|
|
|
2016-04-20 14:46:33 -04:00
|
|
|
enum remote_method_enum {
|
|
|
|
REMOTE_METHOD_OPENURL,
|
|
|
|
REMOTE_METHOD_PING,
|
|
|
|
REMOTE_METHOD_XFEDOCOMMAND,
|
|
|
|
REMOTE_METHOD_ADDBOOKMARK,
|
|
|
|
REMOTE_METHOD_INFOBOX,
|
2017-05-16 12:37:29 -04:00
|
|
|
REMOTE_METHOD_RELOAD,
|
2020-04-25 07:59:40 -04:00
|
|
|
REMOTE_METHOD_SEARCH,
|
2016-04-20 14:46:33 -04:00
|
|
|
REMOTE_METHOD_NOT_SUPPORTED,
|
|
|
|
};
|
|
|
|
|
2007-10-12 10:24:41 -04:00
|
|
|
struct remote_method {
|
2022-01-30 08:24:52 -05:00
|
|
|
const char *name;
|
2016-04-20 14:46:33 -04:00
|
|
|
enum remote_method_enum type;
|
2007-10-12 10:24:41 -04:00
|
|
|
};
|
|
|
|
|
2021-01-02 10:20:27 -05:00
|
|
|
static char *
|
|
|
|
remote_cmd(struct option *o, char ***argv, int *argc)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
2007-10-12 10:24:41 -04:00
|
|
|
struct remote_method remote_methods[] = {
|
2005-09-15 09:58:31 -04:00
|
|
|
{ "openURL", REMOTE_METHOD_OPENURL },
|
|
|
|
{ "ping", REMOTE_METHOD_PING },
|
|
|
|
{ "addBookmark", REMOTE_METHOD_ADDBOOKMARK },
|
|
|
|
{ "infoBox", REMOTE_METHOD_INFOBOX },
|
|
|
|
{ "xfeDoCommand", REMOTE_METHOD_XFEDOCOMMAND },
|
2017-05-16 12:37:29 -04:00
|
|
|
{ "reload", REMOTE_METHOD_RELOAD },
|
2020-04-25 07:59:40 -04:00
|
|
|
{ "search", REMOTE_METHOD_SEARCH },
|
2005-09-15 09:58:31 -04:00
|
|
|
{ NULL, REMOTE_METHOD_NOT_SUPPORTED },
|
|
|
|
};
|
2021-01-02 10:20:27 -05:00
|
|
|
char *command, *arg, *argend, *argstring;
|
2005-09-15 09:58:31 -04:00
|
|
|
int method, len = 0;
|
2021-01-02 10:20:27 -05:00
|
|
|
char *remote_argv[10];
|
2006-12-04 15:54:39 -05:00
|
|
|
int remote_argc;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
if (*argc < 1) return gettext("Parameter expected");
|
|
|
|
|
|
|
|
command = *(*argv);
|
|
|
|
|
2006-11-13 17:22:06 -05:00
|
|
|
while (isasciialpha(command[len]))
|
2005-09-15 09:58:31 -04:00
|
|
|
len++;
|
|
|
|
|
2006-11-12 12:48:16 -05:00
|
|
|
/* Find the begining and end of the argument list. */
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2006-11-12 12:48:16 -05:00
|
|
|
arg = command + len;
|
|
|
|
skip_space(arg);
|
|
|
|
|
|
|
|
argend = arg + strlen(arg);
|
|
|
|
skipback_whitespace(arg, argend);
|
|
|
|
if (argend > arg)
|
|
|
|
argend--;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2006-11-12 12:48:16 -05:00
|
|
|
/* Decide whether to use the "extended" --remote format where
|
|
|
|
* all URLs following should be opened in tabs. */
|
2006-11-13 17:22:06 -05:00
|
|
|
if (len == 0 || *arg != '(' || *argend != ')') {
|
2006-11-03 22:06:50 -05:00
|
|
|
/* Just open any passed URLs in new tabs */
|
|
|
|
remote_session_flags |= SES_REMOTE_NEW_TAB;
|
|
|
|
return NULL;
|
2005-09-15 09:58:31 -04:00
|
|
|
}
|
|
|
|
|
2006-11-12 12:48:16 -05:00
|
|
|
arg++;
|
2006-12-04 15:54:39 -05:00
|
|
|
|
|
|
|
arg = argstring = memacpy(arg, argend - arg);
|
|
|
|
if (!argstring)
|
|
|
|
return gettext("Out of memory");
|
|
|
|
|
|
|
|
remote_argc = 0;
|
|
|
|
do {
|
2021-01-02 10:20:27 -05:00
|
|
|
char *start, *end;
|
2006-12-04 15:54:39 -05:00
|
|
|
|
|
|
|
if (remote_argc > sizeof_array(remote_argv)) {
|
|
|
|
mem_free(argstring);
|
|
|
|
return gettext("Too many arguments");
|
|
|
|
}
|
|
|
|
|
|
|
|
/* Skip parenthesis, comma, and surrounding whitespace. */
|
|
|
|
skip_space(arg);
|
|
|
|
start = arg;
|
|
|
|
|
|
|
|
if (*start == '"') {
|
|
|
|
end = ++start;
|
2022-01-18 14:30:48 -05:00
|
|
|
while ((end = strchr(end, '"'))) {
|
2006-12-04 15:54:39 -05:00
|
|
|
/* Treat "" inside quoted arg as ". */
|
|
|
|
if (end[1] != '"')
|
|
|
|
break;
|
|
|
|
|
|
|
|
end += 2;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!end)
|
|
|
|
return gettext("Mismatched ending argument quoting");
|
|
|
|
|
|
|
|
arg = end + 1;
|
|
|
|
skip_space(arg);
|
|
|
|
if (*arg && *arg != ',')
|
|
|
|
return gettext("Garbage after quoted argument");
|
|
|
|
|
|
|
|
remote_argv[remote_argc++] = start;
|
|
|
|
*end = 0;
|
|
|
|
|
|
|
|
/* Unescape "" to ". */
|
|
|
|
for (end = start; *end; start++, end++) {
|
|
|
|
*start = *end;
|
|
|
|
if (*end == '"')
|
|
|
|
end++;
|
|
|
|
}
|
|
|
|
*start = 0;
|
|
|
|
|
|
|
|
} else {
|
2022-01-18 14:30:48 -05:00
|
|
|
end = strchr(start, ',');
|
2007-11-22 13:09:20 -05:00
|
|
|
if (!end) {
|
2006-12-04 15:54:39 -05:00
|
|
|
end = start + strlen(start);
|
2007-11-22 13:09:20 -05:00
|
|
|
arg = end;
|
|
|
|
} else {
|
|
|
|
arg = end + 1;
|
|
|
|
}
|
2006-12-04 15:54:39 -05:00
|
|
|
skipback_whitespace(start, end);
|
|
|
|
|
|
|
|
if (start != end)
|
|
|
|
remote_argv[remote_argc++] = start;
|
|
|
|
*end = 0;
|
|
|
|
}
|
|
|
|
|
|
|
|
if (*arg == ',')
|
|
|
|
arg++;
|
|
|
|
} while (*arg);
|
2006-11-03 22:06:50 -05:00
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
for (method = 0; remote_methods[method].name; method++) {
|
2022-01-30 08:24:52 -05:00
|
|
|
const char *name = remote_methods[method].name;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2008-10-18 21:25:00 -04:00
|
|
|
if (!c_strlcasecmp(command, len, name, -1))
|
2005-09-15 09:58:31 -04:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
switch (remote_methods[method].type) {
|
|
|
|
case REMOTE_METHOD_OPENURL:
|
2006-12-04 15:54:39 -05:00
|
|
|
if (remote_argc < 1) {
|
2005-09-15 09:58:31 -04:00
|
|
|
/* Prompt for a URL with a dialog box */
|
|
|
|
remote_session_flags |= SES_REMOTE_PROMPT_URL;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2006-12-04 15:54:39 -05:00
|
|
|
if (remote_argc == 2) {
|
2021-01-02 10:20:27 -05:00
|
|
|
char *where = remote_argv[1];
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-18 14:55:08 -05:00
|
|
|
if (strstr(where, "new-window")) {
|
2005-09-15 09:58:31 -04:00
|
|
|
remote_session_flags |= SES_REMOTE_NEW_WINDOW;
|
|
|
|
|
2022-01-18 14:55:08 -05:00
|
|
|
} else if (strstr(where, "new-tab")) {
|
2005-09-15 09:58:31 -04:00
|
|
|
remote_session_flags |= SES_REMOTE_NEW_TAB;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
/* Bail out when getting unknown parameter */
|
|
|
|
/* TODO: new-screen */
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
} else {
|
|
|
|
remote_session_flags |= SES_REMOTE_CURRENT_TAB;
|
|
|
|
}
|
|
|
|
|
2006-12-04 15:54:39 -05:00
|
|
|
remote_url = stracpy(remote_argv[0]);
|
2005-09-15 09:58:31 -04:00
|
|
|
break;
|
|
|
|
|
|
|
|
case REMOTE_METHOD_XFEDOCOMMAND:
|
2006-12-04 15:54:39 -05:00
|
|
|
if (remote_argc < 1)
|
|
|
|
break;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2008-10-18 21:25:00 -04:00
|
|
|
if (!c_strcasecmp(remote_argv[0], "openBrowser")) {
|
2005-09-15 09:58:31 -04:00
|
|
|
remote_session_flags = SES_REMOTE_NEW_WINDOW;
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REMOTE_METHOD_PING:
|
|
|
|
remote_session_flags = SES_REMOTE_PING;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REMOTE_METHOD_ADDBOOKMARK:
|
2006-12-04 15:54:39 -05:00
|
|
|
if (remote_argc < 1)
|
|
|
|
break;
|
|
|
|
remote_url = stracpy(remote_argv[0]);
|
2005-09-15 09:58:31 -04:00
|
|
|
remote_session_flags = SES_REMOTE_ADD_BOOKMARK;
|
|
|
|
break;
|
|
|
|
|
|
|
|
case REMOTE_METHOD_INFOBOX:
|
2006-12-04 15:54:39 -05:00
|
|
|
if (remote_argc < 1)
|
|
|
|
break;
|
|
|
|
remote_url = stracpy(remote_argv[0]);
|
2005-09-15 09:58:31 -04:00
|
|
|
if (remote_url)
|
|
|
|
insert_in_string(&remote_url, 0, "about:", 6);
|
|
|
|
remote_session_flags = SES_REMOTE_INFO_BOX;
|
|
|
|
break;
|
|
|
|
|
2017-05-16 12:37:29 -04:00
|
|
|
case REMOTE_METHOD_RELOAD:
|
|
|
|
remote_session_flags = SES_REMOTE_RELOAD;
|
|
|
|
break;
|
|
|
|
|
2020-04-25 07:59:40 -04:00
|
|
|
case REMOTE_METHOD_SEARCH:
|
2020-04-26 05:45:46 -04:00
|
|
|
if (remote_argc < 1) {
|
|
|
|
remote_url = stracpy("search:");
|
|
|
|
} else {
|
2020-04-25 07:59:40 -04:00
|
|
|
remote_url = stracpy(remote_argv[0]);
|
2020-04-26 05:45:46 -04:00
|
|
|
if (remote_url) {
|
|
|
|
insert_in_string(&remote_url, 0,
|
2020-04-25 07:59:40 -04:00
|
|
|
"search:", sizeof("search:") - 1);
|
2020-04-26 05:45:46 -04:00
|
|
|
}
|
|
|
|
}
|
2020-04-25 07:59:40 -04:00
|
|
|
remote_session_flags = SES_REMOTE_SEARCH;
|
|
|
|
break;
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
case REMOTE_METHOD_NOT_SUPPORTED:
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2006-12-04 15:54:39 -05:00
|
|
|
mem_free(argstring);
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
/* If no flags was applied it can only mean we are dealing with
|
|
|
|
* unknown method. */
|
|
|
|
if (!remote_session_flags)
|
|
|
|
return gettext("Remote method not supported");
|
|
|
|
|
|
|
|
(*argv)++; (*argc)--; /* Consume next argument */
|
|
|
|
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2021-01-02 10:20:27 -05:00
|
|
|
static char *
|
|
|
|
version_cmd(struct option *o, char ***argv, int *argc)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
|
|
|
printf("%s\n", full_static_version);
|
|
|
|
fflush(stdout);
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/* Below we handle help usage printing.
|
|
|
|
*
|
|
|
|
* We're trying to achieve several goals here:
|
|
|
|
*
|
|
|
|
* - Genericly define a function to print option trees iteratively.
|
|
|
|
* - Make output parsable for various doc tools (to make manpages).
|
|
|
|
* - Do some non generic fancy stuff like printing semi-aliased
|
|
|
|
* options (like: -?, -h and -help) on one line when printing
|
|
|
|
* short help. */
|
|
|
|
|
|
|
|
#define gettext_nonempty(x) (*(x) ? gettext(x) : (x))
|
|
|
|
|
2021-01-02 10:20:27 -05:00
|
|
|
static void print_option_desc(const char *desc)
|
2009-03-08 07:28:13 -04:00
|
|
|
{
|
2019-04-21 06:27:40 -04:00
|
|
|
struct string wrapped;
|
|
|
|
static const struct string indent = INIT_STRING(" ", 12);
|
2009-03-08 07:28:13 -04:00
|
|
|
|
|
|
|
if (init_string(&wrapped)
|
|
|
|
&& wrap_option_desc(&wrapped, desc, &indent, 79 - indent.length)) {
|
2019-04-21 06:27:40 -04:00
|
|
|
/* struct string could in principle contain null
|
2009-03-08 07:28:13 -04:00
|
|
|
* characters, so don't use printf() or fputs(). */
|
|
|
|
fwrite(wrapped.source, 1, wrapped.length, stdout);
|
|
|
|
} else {
|
|
|
|
/* Write the error to stderr so it appears on the
|
|
|
|
* screen even if stdout is being parsed by a script
|
|
|
|
* that reformats it to HTML or such. */
|
|
|
|
fprintf(stderr, "%12s%s\n", "",
|
|
|
|
gettext("Out of memory formatting option documentation"));
|
|
|
|
}
|
|
|
|
|
|
|
|
/* done_string() is safe even if init_string() failed. */
|
|
|
|
done_string(&wrapped);
|
|
|
|
}
|
|
|
|
|
2022-02-05 09:51:27 -05:00
|
|
|
static void print_full_help_outer(struct option *tree, const char *path);
|
2008-03-15 19:06:42 -04:00
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
static void
|
2022-02-05 09:51:27 -05:00
|
|
|
print_full_help_inner(struct option *tree, const char *path,
|
2008-03-15 19:06:42 -04:00
|
|
|
int trees)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
|
|
|
struct option *option;
|
2021-01-02 10:20:27 -05:00
|
|
|
char saved[MAX_STR_LEN];
|
|
|
|
char *savedpos = saved;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
*savedpos = 0;
|
|
|
|
|
|
|
|
foreach (option, *tree->value.tree) {
|
|
|
|
enum option_type type = option->type;
|
2021-01-02 10:20:27 -05:00
|
|
|
char *help;
|
2022-01-29 13:01:57 -05:00
|
|
|
const char *capt = option->capt;
|
2021-01-02 10:20:27 -05:00
|
|
|
char *desc = (option->desc && *option->desc)
|
|
|
|
? (char *) gettext(option->desc)
|
|
|
|
: (char *) "N/A";
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2008-03-15 19:06:42 -04:00
|
|
|
if (trees != (type == OPT_TREE))
|
|
|
|
continue;
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
/* Don't print deprecated aliases (if we don't walk command
|
|
|
|
* line options which use aliases for legitimate options). */
|
|
|
|
if ((type == OPT_ALIAS && tree != cmdline_options)
|
|
|
|
|| (option->flags & OPT_HIDDEN))
|
|
|
|
continue;
|
|
|
|
|
2008-10-18 21:25:00 -04:00
|
|
|
if (!capt && !c_strncasecmp(option->name, "_template_", 10))
|
2021-01-02 10:20:27 -05:00
|
|
|
capt = (char *) N_("Template option folder");
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
if (!capt) {
|
|
|
|
int len = strlen(option->name);
|
|
|
|
int max = MAX_STR_LEN - (savedpos - saved);
|
|
|
|
|
|
|
|
safe_strncpy(savedpos, option->name, max);
|
|
|
|
safe_strncpy(savedpos + len, ", -", max - len);
|
|
|
|
savedpos += len + 3;
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
help = gettext_nonempty(option_types[option->type].help_str);
|
|
|
|
|
|
|
|
if (type != OPT_TREE)
|
|
|
|
printf(" %s%s%s %s ",
|
|
|
|
path, saved, option->name, help);
|
|
|
|
|
|
|
|
/* Print the 'title' of each option type. */
|
|
|
|
switch (type) {
|
|
|
|
case OPT_BOOL:
|
|
|
|
case OPT_INT:
|
|
|
|
case OPT_LONG:
|
|
|
|
printf(gettext("(default: %ld)"),
|
|
|
|
type == OPT_LONG
|
|
|
|
? option->value.big_number
|
|
|
|
: (long) option->value.number);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_STRING:
|
|
|
|
printf(gettext("(default: \"%s\")"),
|
|
|
|
option->value.string);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_ALIAS:
|
|
|
|
printf(gettext("(alias for %s)"),
|
|
|
|
option->value.string);
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_CODEPAGE:
|
|
|
|
printf(gettext("(default: %s)"),
|
|
|
|
get_cp_name(option->value.number));
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_COLOR:
|
|
|
|
{
|
|
|
|
color_T color = option->value.color;
|
2021-01-02 10:20:27 -05:00
|
|
|
char hexcolor[8];
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
printf(gettext("(default: %s)"),
|
|
|
|
get_color_string(color, hexcolor));
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
case OPT_COMMAND:
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_LANGUAGE:
|
|
|
|
#ifdef CONFIG_NLS
|
|
|
|
printf(gettext("(default: \"%s\")"),
|
|
|
|
language_to_name(option->value.number));
|
2021-12-20 11:00:16 -05:00
|
|
|
#else
|
|
|
|
printf(gettext("(default: \"%s\")"),
|
|
|
|
"System");
|
2005-09-15 09:58:31 -04:00
|
|
|
#endif
|
|
|
|
break;
|
|
|
|
|
|
|
|
case OPT_TREE:
|
|
|
|
{
|
|
|
|
int pathlen = strlen(path);
|
|
|
|
int namelen = strlen(option->name);
|
|
|
|
|
|
|
|
if (pathlen + namelen + 2 > MAX_STR_LEN)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* Append option name to path */
|
|
|
|
if (pathlen > 0) {
|
|
|
|
memcpy(saved, path, pathlen);
|
|
|
|
savedpos = saved + pathlen;
|
|
|
|
} else {
|
|
|
|
savedpos = saved;
|
|
|
|
}
|
|
|
|
memcpy(savedpos, option->name, namelen + 1);
|
|
|
|
savedpos += namelen;
|
|
|
|
|
|
|
|
capt = gettext_nonempty(capt);
|
|
|
|
printf(" %s: (%s)", capt, saved);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2009-03-08 07:28:13 -04:00
|
|
|
putchar('\n');
|
|
|
|
print_option_desc(desc);
|
|
|
|
putchar('\n');
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
if (option->type == OPT_TREE) {
|
|
|
|
memcpy(savedpos, ".", 2);
|
2008-03-15 19:06:42 -04:00
|
|
|
print_full_help_outer(option, saved);
|
2005-09-15 09:58:31 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
savedpos = saved;
|
|
|
|
*savedpos = 0;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-03-15 19:06:42 -04:00
|
|
|
static void
|
2022-02-05 09:51:27 -05:00
|
|
|
print_full_help_outer(struct option *tree, const char *path)
|
2008-03-15 19:06:42 -04:00
|
|
|
{
|
|
|
|
print_full_help_inner(tree, path, 0);
|
|
|
|
print_full_help_inner(tree, path, 1);
|
|
|
|
}
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
static void
|
2005-11-24 09:38:47 -05:00
|
|
|
print_short_help(void)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
|
|
|
#define ALIGN_WIDTH 20
|
|
|
|
struct option *option;
|
2019-04-21 06:27:40 -04:00
|
|
|
struct string string = NULL_STRING;
|
|
|
|
struct string *saved = NULL;
|
2021-01-02 10:20:27 -05:00
|
|
|
char align[ALIGN_WIDTH];
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
/* Initialize @space used to align captions. */
|
|
|
|
memset(align, ' ', sizeof(align) - 1);
|
|
|
|
align[sizeof(align) - 1] = 0;
|
|
|
|
|
|
|
|
foreach (option, *cmdline_options->value.tree) {
|
2022-01-29 13:01:57 -05:00
|
|
|
const char *capt;
|
2021-01-02 10:20:27 -05:00
|
|
|
char *help;
|
|
|
|
char *info = saved ? saved->source
|
|
|
|
: (char *) "";
|
2005-09-15 09:58:31 -04:00
|
|
|
int len = strlen(option->name);
|
|
|
|
|
|
|
|
/* Avoid printing compatibility options */
|
|
|
|
if (option->flags & OPT_HIDDEN)
|
|
|
|
continue;
|
|
|
|
|
|
|
|
/* When no caption is available the option name is 'stacked'
|
|
|
|
* and the caption is shared with next options that has one. */
|
|
|
|
if (!option->capt) {
|
|
|
|
if (!saved) {
|
|
|
|
if (!init_string(&string))
|
|
|
|
continue;
|
|
|
|
|
|
|
|
saved = &string;
|
|
|
|
}
|
|
|
|
|
|
|
|
add_to_string(saved, option->name);
|
|
|
|
add_to_string(saved, ", -");
|
|
|
|
continue;
|
|
|
|
}
|
|
|
|
|
|
|
|
capt = gettext_nonempty(option->capt);
|
|
|
|
help = gettext_nonempty(option_types[option->type].help_str);
|
|
|
|
|
|
|
|
/* When @help string is non empty align at least one space. */
|
|
|
|
len = ALIGN_WIDTH - len - strlen(help);
|
|
|
|
len -= (saved ? saved->length : 0);
|
|
|
|
len = (len < 0) ? !!(*help) : len;
|
|
|
|
|
|
|
|
align[len] = '\0';
|
|
|
|
printf(" -%s%s %s%s%s\n",
|
|
|
|
info, option->name, help, align, capt);
|
|
|
|
align[len] = ' ';
|
|
|
|
if (saved) {
|
|
|
|
done_string(saved);
|
|
|
|
saved = NULL;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
#undef ALIGN_WIDTH
|
|
|
|
}
|
|
|
|
|
|
|
|
#undef gettext_nonempty
|
|
|
|
|
2021-01-02 10:20:27 -05:00
|
|
|
static char *
|
|
|
|
printhelp_cmd(struct option *option, char ***argv, int *argc)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
2022-01-18 14:30:48 -05:00
|
|
|
char *lineend = strchr(full_static_version, '\n');
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
if (lineend) *lineend = '\0';
|
|
|
|
|
|
|
|
printf("%s\n\n", full_static_version);
|
|
|
|
|
|
|
|
if (!strcmp(option->name, "config-help")) {
|
|
|
|
printf("%s:\n", gettext("Configuration options"));
|
2008-03-15 19:06:42 -04:00
|
|
|
print_full_help_outer(config_options, "");
|
2005-09-15 09:58:31 -04:00
|
|
|
} else {
|
|
|
|
printf("%s\n\n%s:\n",
|
|
|
|
gettext("Usage: elinks [OPTION]... [URL]..."),
|
|
|
|
gettext("Options"));
|
|
|
|
if (!strcmp(option->name, "long-help")) {
|
2008-03-15 19:06:42 -04:00
|
|
|
print_full_help_outer(cmdline_options, "-");
|
2005-09-15 09:58:31 -04:00
|
|
|
} else {
|
|
|
|
print_short_help();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
fflush(stdout);
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
2021-01-02 10:20:27 -05:00
|
|
|
static char *
|
|
|
|
redir_cmd(struct option *option, char ***argv, int *argc)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
2021-01-02 10:20:27 -05:00
|
|
|
char *target;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
/* I can't get any dirtier. --pasky */
|
|
|
|
|
|
|
|
if (!strcmp(option->name, "confdir")) {
|
|
|
|
target = "config-dir";
|
|
|
|
} else if (!strcmp(option->name, "conffile")) {
|
|
|
|
target = "config-file";
|
|
|
|
} else if (!strcmp(option->name, "stdin")) {
|
|
|
|
static int complained;
|
|
|
|
|
|
|
|
if (complained)
|
|
|
|
return NULL;
|
|
|
|
complained = 1;
|
|
|
|
|
|
|
|
/* Emulate bool option, possibly eating following 0/1. */
|
|
|
|
if ((*argv)[0]
|
|
|
|
&& ((*argv)[0][0] == '0' || (*argv)[0][0] == '1')
|
|
|
|
&& !(*argv)[0][1])
|
|
|
|
(*argv)++, (*argc)--;
|
|
|
|
fprintf(stderr, "Warning: Deprecated option -stdin used!\n");
|
|
|
|
fprintf(stderr, "ELinks now determines the -stdin option value automatically.\n");
|
|
|
|
fprintf(stderr, "In the future versions ELinks will report error when you will\n");
|
|
|
|
fprintf(stderr, "continue to use this option.\a\n");
|
|
|
|
return NULL;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
return gettext("Internal consistency error");
|
|
|
|
}
|
|
|
|
|
|
|
|
option = get_opt_rec(cmdline_options, target);
|
|
|
|
assert(option);
|
|
|
|
option_types[option->type].cmdline(option, argv, argc);
|
|
|
|
return NULL;
|
|
|
|
}
|
|
|
|
|
2021-01-02 10:20:27 -05:00
|
|
|
static char *
|
|
|
|
printconfigdump_cmd(struct option *option, char ***argv, int *argc)
|
2005-09-15 09:58:31 -04:00
|
|
|
{
|
2021-01-02 10:20:27 -05:00
|
|
|
char *config_string;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
/* Print all. */
|
2007-08-28 12:41:18 -04:00
|
|
|
get_opt_int("config.saving_style", NULL) = 2;
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2007-08-29 09:43:15 -04:00
|
|
|
config_string = create_config_string("", "");
|
2005-09-15 09:58:31 -04:00
|
|
|
if (config_string) {
|
|
|
|
printf("%s", config_string);
|
|
|
|
mem_free(config_string);
|
|
|
|
}
|
|
|
|
|
|
|
|
fflush(stdout);
|
|
|
|
return "";
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/**********************************************************************
|
|
|
|
Options values
|
|
|
|
**********************************************************************/
|
|
|
|
|
|
|
|
/* Keep options in alphabetical order. */
|
|
|
|
|
bug 764: Initialize the right member of union option_value
INIT_OPTION used to initialize union option_value at compile time by
casting the default value to LIST_OF(struct option) *, which is the
type of the first member. On sparc64 and other big-endian systems
where sizeof(int) < sizeof(struct list_head *), this tended to leave
option->value.number as zero, thus messing up OPT_INT and OPT_BOOL
at least. OPT_LONG however tended to work right.
This would be easy to fix with C99 designated initializers,
but doc/hacking.txt says ELinks must be kept C89 compatible.
Another solution would be to make register_options() read the
value from option->value.tree (the first member), cast it back
to the right type, and write it to the appropriate member;
but that would still require somewhat dubious conversions
between integers, data pointers, and function pointers.
So here's a rather more invasive solution. Add struct option_init,
which is somewhat similar to struct option but has non-overlapping
members for different types of values, to ensure nothing is lost
in compile-time conversions. Move unsigned char *path from struct
option_info to struct option_init, and replace struct option_info
with a union that contains struct option_init and struct option.
Now, this union can be initialized with no portability problems,
and register_options() then moves the values from struct option_init
to their final places in struct option.
In my x86 ELinks build with plenty of options configured in, this
change bloated the text section by 340 bytes but compressed the data
section by 2784 bytes, presumably because union option_info is a
pointer smaller than struct option_info was.
(cherry picked from elinks-0.12 commit e5f6592ee20780a61f70feeb1f9e17631b9c5835)
Conflicts:
src/protocol/fsp/fsp.c: All options had been removed in 0.13.GIT.
src/protocol/smb/smb2.c: Ditto.
2009-08-15 15:39:07 -04:00
|
|
|
union option_info cmdline_options_info[] = {
|
Here is a framework that detects cases where a PO file assigns
the same accelerator key to multiple buttons in a dialog box or
to multiple items in a menu. ELinks already has some support for
this but it requires the translator to run ELinks and manually
scan through all menus and dialogs. The attached changes make it
possible to quickly detect and list any conflicts, including ones
that can only occur on operating systems or configurations that
the translator is not currently using.
The changes have no immediate effect on the elinks executable or
the MO files. PO files become larger, however.
The scheme works like this:
- Like before, accelerator keys in translatable strings are
tagged with the tilde (~) character.
- Whenever a C source file defines an accelerator key, it must
assign one or more named "contexts" to it. The translations in
the PO files inherit these contexts. If multiple strings use
the same accelerator (case insensitive) in the same context,
that's a conflict and can be detected automatically.
- The contexts are defined with "gettext_accelerator_context"
comments in source files. These comments delimit regions where
all translatable strings containing tildes are given the same
contexts. There must be one special comment at the top of the
region; it lists the contexts assigned to that region. The
region automatically ends at the end of the function (found
with regexp /^\}/), but it can also be closed explicitly with
another special comment. The comments are formatted like this:
/* [gettext_accelerator_context(foo, bar, baz)]
begins a region that uses the contexts "foo", "bar", and "baz".
The comma is the delimiter; whitespace is optional.
[gettext_accelerator_context()]
ends the region. */
The scripts don't currently check whether this syntax occurs
inside or outside comments.
- The names of contexts consist of C identifiers delimited with
periods. I typically used the name of a function that sets
up a dialog, or the name of an array where the items of a
menu are listed. There is a special feature for static
functions: if the name begins with a period, then the period
will be replaced with the name of the source file and a colon.
- If a menu is programmatically generated from multiple parts,
of which some are never used together, so that it is safe to
use the same accelerators in them, then it is necessary to
define multiple contexts for the same menu. link_menu() in
src/viewer/text/link.c is the most complex example of this.
- During make update-po:
- A Perl script (po/gather-accelerator-contexts.pl) reads
po/elinks.pot, scans the source files listed in it for
"gettext_accelerator_context" comments, and rewrites
po/elinks.pot with "accelerator_context" comments that
indicate the contexts of each msgid: the union of all
contexts of all of its uses in the source files. It also
removes any "gettext_accelerator_context" comments that
xgettext --add-comments has copied to elinks.pot.
- If po/gather-accelerator-contexts.pl does not find any
contexts for some use of an msgid that seems to contain an
accelerator (because it contains a tilde), it warns. If the
tilde refers to e.g. "~/.elinks" and does not actually mark
an accelerator, the warning can be silenced by specifying the
special context "IGNORE", which the script otherwise ignores.
- msgmerge copies the "accelerator_context" comments from
po/elinks.pot to po/*.po. Translators do not edit those
comments.
- During make check-po:
- Another Perl script (po/check-accelerator-contexts.pl) reads
po/*.po and keeps track of which accelerators have been bound
in each context. It warns about any conflicts it finds.
This script does not access the C source files; thus it does
not matter if the line numbers in "#:" lines are out of date.
This implementation is not perfect and I am not proposing to
add it to the main source tree at this time. Specifically:
- It introduces compile-time dependencies on Perl and Locale::PO.
There should be a configure-time or compile-time check so that
the new features are skipped if the prerequisites are missing.
- When the scripts include msgstr strings in warnings, they
should transcode them from the charset of the PO file to the
one specified by the user's locale.
- It is not adequately documented (well, except perhaps here).
- po/check-accelerator-contexts.pl reports the same conflict
multiple times if it occurs in multiple contexts.
- The warning messages should include line numbers, so that users
of Emacs could conveniently edit the conflicting part of the PO
file. This is not feasible with the current version of
Locale::PO.
- Locale::PO does not understand #~ lines and spews warnings
about them. There is an ugly hack to hide these warnings.
- Jonas Fonseca suggested the script could propose accelerators
that are still available. This has not been implemented.
There are three files attached:
- po/gather-accelerator-contexts.pl: Augments elinks.pot with
context information.
- po/check-accelerator-contexts.pl: Checks conflicts.
- accelerator-contexts.diff: Makes po/Makefile run the scripts,
and adds special comments to source files.
2005-12-04 18:38:29 -05:00
|
|
|
/* [gettext_accelerator_context(IGNORE)] */
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_BOOL(C_(""), N_("Load config also for slave instances"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"always-load-config", OPT_ZERO, 0,
|
2022-01-04 09:15:39 -05:00
|
|
|
N_("Load config also for slave instances. Slower, but more robust.")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_BOOL(C_(""), N_("Restrict to anonymous mode"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"anonymous", OPT_ZERO, 0,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Restricts ELinks so it can run on an anonymous account. "
|
|
|
|
"Local file browsing, downloads, and modification of options "
|
|
|
|
"will be disabled. Execution of viewers is allowed, but "
|
|
|
|
"entries in the association table can't be added or "
|
|
|
|
"modified.")),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_BOOL(C_(""), N_("Autosubmit first form"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"auto-submit", OPT_ZERO, 0,
|
2005-09-15 09:58:31 -04:00
|
|
|
N_("Automatically submit the first form in the given URLs.")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_INT(C_(""), N_("Clone internal session with given ID"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"base-session", OPT_ZERO, 0, INT_MAX, 0,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Used internally when opening ELinks instances in new "
|
|
|
|
"windows. The ID maps to information that will be used when "
|
|
|
|
"creating the new instance. You don't want to use it.")),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_STRING(C_(""), N_("Use a specific local IP address"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"bind-address", OPT_ZERO, "",
|
2020-05-05 15:18:29 -04:00
|
|
|
N_("Use a specific local IP address")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_STRING(C_(""), N_("Use a specific local IPv6 address"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"bind-address-ipv6", OPT_ZERO, "",
|
2020-05-05 15:39:54 -04:00
|
|
|
N_("Use a specific local IPv6 address")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), NULL, "confdir", OPT_HIDDEN, redir_cmd, NULL),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_STRING(C_(""), N_("Name of directory with configuration file"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"config-dir", OPT_ZERO, "",
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Path of the directory ELinks will read and write its "
|
|
|
|
"config and runtime state files to instead of ~/.elinks. "
|
|
|
|
"If the path does not begin with a '/' it is assumed to be "
|
2005-09-15 09:58:31 -04:00
|
|
|
"relative to your HOME directory.")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), N_("Print default configuration file to stdout"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"config-dump", OPT_ZERO, printconfigdump_cmd,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Print a configuration file with options set to the "
|
|
|
|
"built-in defaults to stdout.")),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), NULL, "conffile", OPT_HIDDEN, redir_cmd, NULL),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_STRING(C_(""), N_("Name of configuration file"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"config-file", OPT_ZERO, "elinks.conf",
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Name of the configuration file that all configuration "
|
|
|
|
"options will be read from and written to. It should be "
|
2005-09-15 09:58:31 -04:00
|
|
|
"relative to config-dir.")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), N_("Print help for configuration options"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"config-help", OPT_ZERO, printhelp_cmd,
|
2005-09-15 09:58:31 -04:00
|
|
|
N_("Print help for configuration options and exit.")),
|
|
|
|
|
|
|
|
INIT_OPT_CMDALIAS("", N_("MIME type assumed for unknown document types"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"default-mime-type", OPT_ZERO, "mime.default_type",
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("The default MIME type used for documents of unknown "
|
|
|
|
"type.")),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_BOOL(C_(""), N_("Ignore user-defined keybindings"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"default-keys", OPT_ZERO, 0,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("When set, all keybindings from configuration files will "
|
|
|
|
"be ignored. It forces use of default keybindings and will "
|
|
|
|
"reset user-defined ones on save.")),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_BOOL(C_(""), N_("Print formatted versions of given URLs to stdout"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"dump", OPT_ZERO, 0,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Print formatted plain-text versions of given URLs to "
|
|
|
|
"stdout.")),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
|
|
|
INIT_OPT_CMDALIAS("", N_("Codepage to use with -dump"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"dump-charset", OPT_ZERO, "document.dump.codepage",
|
2005-09-15 09:58:31 -04:00
|
|
|
N_("Codepage used when formatting dump output.")),
|
|
|
|
|
2006-03-04 08:33:28 -05:00
|
|
|
INIT_OPT_CMDALIAS("", N_("Color mode used with -dump"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"dump-color-mode", OPT_ZERO, "document.dump.color_mode",
|
2006-03-04 08:33:28 -05:00
|
|
|
N_("Color mode used with -dump.")),
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
INIT_OPT_CMDALIAS("", N_("Width of document formatted with -dump"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"dump-width", OPT_ZERO, "document.dump.width",
|
2005-09-15 09:58:31 -04:00
|
|
|
N_("Width of the dump output.")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), N_("Evaluate configuration file directive"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"eval", OPT_ZERO, eval_cmd,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Specify configuration file directives on the command-line "
|
|
|
|
"which will be evaluated after all configuration files has "
|
|
|
|
"been read. Example usage:\n"
|
2005-09-15 09:58:31 -04:00
|
|
|
"\t-eval 'set protocol.file.allow_special_files = 1'")),
|
|
|
|
|
|
|
|
/* lynx compatibility */
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), N_("Interpret documents of unknown types as HTML"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"force-html", OPT_ZERO, forcehtml_cmd,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Makes ELinks assume documents of unknown types are HTML. "
|
|
|
|
"Useful when using ELinks as an external viewer from MUAs. "
|
2005-09-15 09:58:31 -04:00
|
|
|
"This is equivalent to -default-mime-type text/html.")),
|
|
|
|
|
|
|
|
/* XXX: -?, -h and -help share the same caption and should be kept in
|
|
|
|
* the current order for usage help printing to be ok */
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), NULL, "?", OPT_ZERO, printhelp_cmd, NULL),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), NULL, "h", OPT_ZERO, printhelp_cmd, NULL),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), N_("Print usage help and exit"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"help", OPT_ZERO, printhelp_cmd,
|
2005-09-15 09:58:31 -04:00
|
|
|
N_("Print usage help and exit.")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_BOOL(C_(""), N_("Only permit local connections"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"localhost", OPT_ZERO, 0,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Restricts ELinks to work offline and only connect to "
|
|
|
|
"servers with local addresses (ie. 127.0.0.1). No connections "
|
|
|
|
"to remote servers will be permitted.")),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), N_("Print detailed usage help and exit"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"long-help", OPT_ZERO, printhelp_cmd,
|
2005-09-15 09:58:31 -04:00
|
|
|
N_("Print detailed usage help and exit.")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), N_("Look up specified host"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"lookup", OPT_ZERO, lookup_cmd,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Look up specified host and print all DNS resolved IP "
|
|
|
|
"addresses.")),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_BOOL(C_(""), N_("Run as separate instance"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"no-connect", OPT_ZERO, 0,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Run ELinks as a separate instance instead of connecting "
|
|
|
|
"to an existing instance. Note that normally no runtime state "
|
|
|
|
"files (bookmarks, history, etc.) are written to the disk "
|
|
|
|
"when this option is used. See also -touch-files.")),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_BOOL(C_(""), N_("Disable use of files in ~/.elinks"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"no-home", OPT_ZERO, 0,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Disables creation and use of files in the user specific "
|
|
|
|
"home configuration directory (~/.elinks). It forces default "
|
|
|
|
"configuration values to be used and disables saving of "
|
|
|
|
"runtime state files.")),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_BOOL(C_(""), N_("Disable libevent"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"no-libevent", OPT_ZERO, 0,
|
2017-11-16 12:23:47 -05:00
|
|
|
N_("Disables libevent.")),
|
|
|
|
|
2005-09-15 09:58:31 -04:00
|
|
|
INIT_OPT_CMDALIAS("", N_("Disable link numbering in dump output"),
|
|
|
|
"no-numbering", OPT_ALIAS_NEGATE, "document.dump.numbering",
|
|
|
|
N_("Prevents printing of link number in dump output.\n"
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
"\n"
|
2005-09-15 09:58:31 -04:00
|
|
|
"Note that this really affects only -dump, nothing else.")),
|
|
|
|
|
|
|
|
INIT_OPT_CMDALIAS("", N_("Disable printing of link references in dump output"),
|
|
|
|
"no-references", OPT_ALIAS_NEGATE, "document.dump.references",
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Prevents printing of references (URIs) of document links "
|
2005-09-15 09:58:31 -04:00
|
|
|
"in dump output.\n"
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
"\n"
|
2005-09-15 09:58:31 -04:00
|
|
|
"Note that this really affects only -dump, nothing else.")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), N_("Control an already running ELinks"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"remote", OPT_ZERO, remote_cmd,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("Control a remote ELinks instance by passing commands to "
|
|
|
|
"it. The option takes an additional argument containing the "
|
|
|
|
"method which should be invoked and any parameters that "
|
|
|
|
"should be passed to it. For ease of use, the additional "
|
|
|
|
"method argument can be omitted in which case any URL "
|
|
|
|
"arguments will be opened in new tabs in the remote "
|
|
|
|
"instance.\n"
|
|
|
|
"\n"
|
2005-09-15 09:58:31 -04:00
|
|
|
"Following is a list of the supported methods:\n"
|
|
|
|
"\tping() : look for a remote instance\n"
|
|
|
|
"\topenURL() : prompt URL in current tab\n"
|
|
|
|
"\topenURL(URL) : open URL in current tab\n"
|
|
|
|
"\topenURL(URL, new-tab) : open URL in new tab\n"
|
|
|
|
"\topenURL(URL, new-window) : open URL in new window\n"
|
|
|
|
"\taddBookmark(URL) : bookmark URL\n"
|
2005-09-15 14:24:24 -04:00
|
|
|
"\tinfoBox(text) : show text in a message box\n"
|
2020-05-06 14:32:19 -04:00
|
|
|
"\treload() : reload the document in the current tab\n"
|
|
|
|
"\tsearch(string) : search in the current tab\n"
|
2005-09-15 09:58:31 -04:00
|
|
|
"\txfeDoCommand(openBrowser) : open new window")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_INT(C_(""), N_("Connect to session ring with given ID"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"session-ring", OPT_ZERO, 0, INT_MAX, 0,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("ID of session ring this ELinks session should connect to. "
|
|
|
|
"ELinks works in so-called session rings, whereby all "
|
|
|
|
"instances of ELinks are interconnected and share state "
|
|
|
|
"(cache, bookmarks, cookies, and so on). By default, all "
|
|
|
|
"ELinks instances connect to session ring 0. You can change "
|
|
|
|
"that behaviour with this switch and form as many session "
|
|
|
|
"rings as you want. Obviously, if the session-ring with this "
|
|
|
|
"number doesn't exist yet, it's created and this ELinks "
|
|
|
|
"instance will become the master instance (that usually "
|
|
|
|
"doesn't matter for you as a user much).\n"
|
|
|
|
"\n"
|
|
|
|
"Note that you usually don't want to use this unless you're a "
|
|
|
|
"developer and you want to do some testing - if you want the "
|
|
|
|
"ELinks instances each running standalone, rather use the "
|
|
|
|
"-no-connect command-line option. Also note that normally no "
|
|
|
|
"runtime state files are written to the disk when this option "
|
|
|
|
"is used. See also -touch-files.")),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_BOOL(C_(""), N_("Print the source of given URLs to stdout"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"source", OPT_ZERO, 0,
|
2005-09-15 09:58:31 -04:00
|
|
|
N_("Print given URLs in source form to stdout.")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), NULL, "stdin", OPT_HIDDEN, redir_cmd, NULL),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_BOOL(C_(""), N_("Whether to use terminfo"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"terminfo", OPT_ZERO, 0,
|
2017-11-19 12:29:38 -05:00
|
|
|
N_("When enabled, terminfo ncurses functions will be used "
|
|
|
|
"instead of hardcoded sequences.")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_BOOL(C_(""), N_("Touch files in ~/.elinks when running with -no-connect/-session-ring"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"touch-files", OPT_ZERO, 0,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("When enabled, runtime state files (bookmarks, history, "
|
|
|
|
"etc.) are written to disk, even when -no-connect or "
|
|
|
|
"-session-ring is used. The option has no effect if not used "
|
|
|
|
"in conjunction with any of these options.")),
|
2005-09-15 09:58:31 -04:00
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_INT(C_(""), N_("Verbose level"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"verbose", OPT_ZERO, 0, VERBOSE_LEVELS - 1, VERBOSE_WARNINGS,
|
Rewrap lines in option documentation.
Documentation strings of most options used to contain a "\n" at the
end of each source line. When the option manager displayed these
strings, it treated each "\n" as a hard newline. On 80x24 terminals
however, the option description window has only 60 columes available
for the text (with the default setup.h), and the hard newlines were
further apart, so the option manager wrapped the text a second time,
resulting in rather ugly output where long lones are interleaved with
short ones. This could also cause the text to take up too much
vertical space and not fit in the window.
Replace most of those hard newlines with spaces so that the option
manager (or perhaps BFU) will take care of the wrapping. At the same
time, rewrap the strings in source code so that the source lines are
at most 79 columns wide.
In some options though, there is a list of possible values and their
meanings. In those lists, if the description of one value does not
fit in one line, then continuation lines should be indented. The
option manager and BFU are not currently able to do that. So, keep
the hard newlines in those lists, but rewrap them to 60 columns so
that they are less likely to require further wrapping at runtime.
2009-03-07 13:48:38 -05:00
|
|
|
N_("The verbose level controls what messages are shown at "
|
2005-09-15 09:58:31 -04:00
|
|
|
"start up and while running:\n"
|
|
|
|
"\t0 means only show serious errors\n"
|
|
|
|
"\t1 means show serious errors and warnings\n"
|
|
|
|
"\t2 means show all messages")),
|
|
|
|
|
2022-01-19 16:49:13 -05:00
|
|
|
INIT_OPT_COMMAND(C_(""), N_("Print version information and exit"),
|
2022-01-15 14:10:37 -05:00
|
|
|
"version", OPT_ZERO, version_cmd,
|
2005-09-15 09:58:31 -04:00
|
|
|
N_("Print ELinks version information and exit.")),
|
|
|
|
|
|
|
|
NULL_OPTION_INFO,
|
|
|
|
};
|