Rename --dump to --stdout. Add --stdin.

This commit is contained in:
Ian Gulliver
2016-02-25 15:12:16 -08:00
parent 46fd0c3c8b
commit 4f14845c75
3 changed files with 29 additions and 18 deletions

View File

@@ -45,15 +45,6 @@ static struct serializer *opts_get_serializer(char **arg) {
return serializer;
}
bool opts_add_dump(char *arg) {
struct serializer *serializer = send_get_serializer(arg);
if (!serializer) {
return false;
}
send_new(dup(1), serializer, NULL);
return true;
}
bool opts_add_connect_receive(char *arg) {
char *host = opts_split(&arg, '/');
if (!host) {
@@ -95,3 +86,17 @@ bool opts_add_listen_send(char *arg) {
opts_add_listen(arg, send_new_wrapper, serializer);
return true;
}
bool opts_add_stdin(char *arg) {
receive_new(dup(0), NULL, NULL);
return true;
}
bool opts_add_stdout(char *arg) {
struct serializer *serializer = send_get_serializer(arg);
if (!serializer) {
return false;
}
send_new(dup(1), serializer, NULL);
return true;
}