diff options
author | default <nobody@localhost> | 2023-02-05 19:54:41 +0100 |
---|---|---|
committer | default <nobody@localhost> | 2023-02-05 19:54:41 +0100 |
commit | f36fb45c3f7356a8ecf98b2e3fc3002dfed99dec (patch) | |
tree | 5b67cb38ab7254d0cb4a5b7cc6b344b8b465ff15 /main.c | |
parent | 7a2cce487c374fe3577b8090887932d09481d78e (diff) |
The 'note' command now accepts -e and -.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -261,10 +261,11 @@ int main(int argc, char *argv[]) xs *c_msg = NULL; char *in_reply_to = GET_ARGV(); - if (strcmp(url, "-") == 0) { + if (strcmp(url, "-e") == 0) { /* get the content from an editor */ FILE *f; + unlink("/tmp/snac-edit.txt"); system("$EDITOR /tmp/snac-edit.txt"); if ((f = fopen("/tmp/snac-edit.txt", "r")) != NULL) { @@ -279,6 +280,11 @@ int main(int argc, char *argv[]) } } else + if (strcmp(url, "-") == 0) { + /* get the content from stdin */ + content = xs_readall(stdin); + } + else content = xs_dup(url); msg = msg_note(&snac, content, NULL, in_reply_to, NULL); |