mirror of
https://github.com/tmate-io/tmate-ssh-server.git
synced 2020-11-18 19:53:51 -08:00
fix command line
This commit is contained in:
parent
b0c843e56f
commit
1fa1a9aca4
@ -44,11 +44,6 @@ struct tmate_settings _tmate_settings = {
|
|||||||
|
|
||||||
struct tmate_settings *tmate_settings = &_tmate_settings;
|
struct tmate_settings *tmate_settings = &_tmate_settings;
|
||||||
|
|
||||||
static void usage(void)
|
|
||||||
{
|
|
||||||
fprintf(stderr, "usage: tmate-slave [-h hostname] [-k keys_dir] [-p port] [-x proxy_hostname] [-q proxy_port] [-s] [-v]\n");
|
|
||||||
}
|
|
||||||
|
|
||||||
void tmate_get_random_bytes(void *buffer, ssize_t len)
|
void tmate_get_random_bytes(void *buffer, ssize_t len)
|
||||||
{
|
{
|
||||||
if (read(dev_urandom_fd, buffer, len) != len)
|
if (read(dev_urandom_fd, buffer, len) != len)
|
||||||
@ -104,23 +99,25 @@ void request_server_termination(void)
|
|||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void usage(void)
|
||||||
|
{
|
||||||
|
fprintf(stderr, "usage: tmate-slave [-h hostname] [-k keys_dir] [-p port] [-x proxy_hostname] [-q proxy_port] [-s] [-v]\n");
|
||||||
|
}
|
||||||
|
|
||||||
int main(int argc, char **argv, char **envp)
|
int main(int argc, char **argv, char **envp)
|
||||||
{
|
{
|
||||||
int opt;
|
int opt;
|
||||||
|
|
||||||
while ((opt = getopt(argc, argv, "h:k:p:lvx:q:")) != -1) {
|
while ((opt = getopt(argc, argv, "h:k:p:x:q:sv")) != -1) {
|
||||||
switch (opt) {
|
switch (opt) {
|
||||||
case 'p':
|
case 'h':
|
||||||
tmate_settings->ssh_port = atoi(optarg);
|
tmate_settings->tmate_host = xstrdup(optarg);
|
||||||
break;
|
break;
|
||||||
case 'k':
|
case 'k':
|
||||||
tmate_settings->keys_dir = xstrdup(optarg);
|
tmate_settings->keys_dir = xstrdup(optarg);
|
||||||
break;
|
break;
|
||||||
case 's':
|
case 'p':
|
||||||
tmate_settings->use_syslog = true;
|
tmate_settings->ssh_port = atoi(optarg);
|
||||||
break;
|
|
||||||
case 'v':
|
|
||||||
tmate_settings->log_level++;
|
|
||||||
break;
|
break;
|
||||||
case 'x':
|
case 'x':
|
||||||
tmate_settings->proxy_hostname = xstrdup(optarg);
|
tmate_settings->proxy_hostname = xstrdup(optarg);
|
||||||
@ -128,8 +125,11 @@ int main(int argc, char **argv, char **envp)
|
|||||||
case 'q':
|
case 'q':
|
||||||
tmate_settings->proxy_port = atoi(optarg);
|
tmate_settings->proxy_port = atoi(optarg);
|
||||||
break;
|
break;
|
||||||
case 'h':
|
case 's':
|
||||||
tmate_settings->tmate_host = xstrdup(optarg);
|
tmate_settings->use_syslog = true;
|
||||||
|
break;
|
||||||
|
case 'v':
|
||||||
|
tmate_settings->log_level++;
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
usage();
|
usage();
|
||||||
@ -147,7 +147,7 @@ int main(int argc, char **argv, char **envp)
|
|||||||
cmdline = *argv;
|
cmdline = *argv;
|
||||||
cmdline_end = *envp;
|
cmdline_end = *envp;
|
||||||
|
|
||||||
init_logging("tmate-ssh",
|
init_logging("tmate-remote-tmux",
|
||||||
tmate_settings->use_syslog, tmate_settings->log_level);
|
tmate_settings->use_syslog, tmate_settings->log_level);
|
||||||
|
|
||||||
tmate_preload_trace_lib();
|
tmate_preload_trace_lib();
|
||||||
|
Loading…
x
Reference in New Issue
Block a user