main.c
changeset 38 f1e581c862d5
parent 37 b0588bddef91
child 40 da3ea7f666e3
equal deleted inserted replaced
37:b0588bddef91 38:f1e581c862d5
    23 int app_stdout;
    23 int app_stdout;
    24 int app_stderr;
    24 int app_stderr;
    25 
    25 
    26 struct Command_line command_line;
    26 struct Command_line command_line;
    27 
    27 
    28 static const char version[] = "0.1";
    28 static const char version[] = "0.2";
    29 
    29 
    30 static int showhelp(const char *pname)
    30 static int showhelp(const char *pname)
    31 {
    31 {
    32     printf("tm v%s - terminal mixer,  Copyright (C) 2007  "
    32     printf("tm v%s - terminal mixer,  Copyright (C) 2007  "
    33             "Lluis Batlle i Rossell\n",
    33             "Lluis Batlle i Rossell\n",
    34             version);
    34             version);
    35     printf("usage: %s [opts] [appcommand] [param1] [param2] ...\n", pname);
    35     printf("usage: %s [opts] [appcommand] [param1] [param2] ...\n", pname);
    36     printf(" If you give _appcommand_, it starts the application and\n");
    36     printf(" If you give _appcommand_, it starts the application and\n");
    37     printf(" a stdin server on $SM_SOCKET or /tmp/socket-sm.UID.\n");
    37     printf(" serves it through a Unix socket on $SM_SOCKET or "
    38     printf(" If not given, it starts a stdin client for the same socket.\n");
    38             "/tmp/socket-sm.UID,\n");
       
    39     printf(" unless '-p' is used.\n");
       
    40     printf(" Without _appcomand_, starts a the Unix socket client.\n");
    39     printf("options: \n");
    41     printf("options: \n");
    40     printf(" -h     Show help.\n");
    42     printf(" -h     Show help.\n");
    41     printf(" -P     Run the child as connected to a pipe (default).\n");
    43     printf(" -P     Run the child as connected to a pipe (default).\n");
    42     printf(" -t     Run the child as connected to a terminal (raw mode in "
    44     printf(" -t     Run the child as connected to a terminal (raw mode in "
    43         "client).\n");
    45         "client).\n");
    44     printf(" -n MAX Serve at most MAX sockets for each transport (1 default)."
    46     printf(" -n MAX Serve at most MAX sockets for each transport (1 default)."
    45             "\n");
    47             "\n");
    46     printf(" -w     The remote clients can write to the application.\n");
    48     printf(" -w     The remote clients can write to the application.\n");
    47     printf(" -x     The remote clients end will close app's stdin.\n");
    49     printf(" -x     The remote clients end will close app's stdin.\n");
    48     printf(" -p NUM Listen to tcp port NUM, and not listen to any Unix socket."
    50     printf(" -p NUM Listen to tcp port NUM for 'telnet', and not listen to "
    49             "\n");
    51             "any\n"
       
    52            "        Unix socket.\n");
    50     printf(" -e     Echo remote input to the server terminal.\n");
    53     printf(" -e     Echo remote input to the server terminal.\n");
    51     printf(" -r     Send xterm's resize control string to clients.\n");
    54     printf(" -r     Send xterm's resize control string to clients.\n");
    52     return 0;
    55     return 0;
    53 }
    56 }
    54 
    57