main.c
branchsaveflie
changeset 94 330324fc7c20
parent 90 f172b95795d8
--- a/main.c	Thu Aug 21 23:21:22 2008 +0200
+++ b/main.c	Wed Feb 16 20:57:32 2011 +0100
@@ -55,6 +55,7 @@
 #ifdef linux
     printf(" -e dev[:port] Also serve/connect using raw ethernet, device 'dev'.\n");
     printf(" -c adr Connect to address (MAC if eth).\n");
+    printf(" -s fil Save the child stdin/stdout to the filename 'fil'.\n");
 #endif /* linux */
     printf(" -x     Send xterm's resize control string to clients.\n");
     return 0;
@@ -112,6 +113,7 @@
     command_line.s_param.echo_in_local_terminal = 0;
     command_line.s_param.send_xterm_resize = 0;
     command_line.s_param.serve_eth = 0;
+    command_line.s_param.savefile = 0;
 
     command_line.tcp_port = 40000; /* Arbitrary */
     command_line.eth_port = 100;   /* Arbitrary */
@@ -132,7 +134,7 @@
     extern int optind, opterr, optopt;
 
     while(1) {
-        c = my_getopt(argc, argv, "tp:nBxdPN:hwCED"
+        c = my_getopt(argc, argv, "s:tp:nBxdPN:hwCED"
 #ifdef linux
                 "c:e:"
 #endif /* linux */
@@ -192,6 +194,9 @@
                 parse_eth_device(optarg);
                 command_line.c_param.transport = ETHERNET;
                 break;
+            case 's':
+                command_line.s_param.savefile = strdup(optarg);
+                break;
             case '?':
                 error("Wrong option %c.\n", optopt);
         }