mirror of
https://codeberg.org/grunfink/snac2.git
synced 2024-11-10 03:50:38 +03:00
The 'note' command now accepts -e and -.
This commit is contained in:
parent
7a2cce487c
commit
f36fb45c3f
8
main.c
8
main.c
@ -261,10 +261,11 @@ int main(int argc, char *argv[])
|
|||||||
xs *c_msg = NULL;
|
xs *c_msg = NULL;
|
||||||
char *in_reply_to = GET_ARGV();
|
char *in_reply_to = GET_ARGV();
|
||||||
|
|
||||||
if (strcmp(url, "-") == 0) {
|
if (strcmp(url, "-e") == 0) {
|
||||||
/* get the content from an editor */
|
/* get the content from an editor */
|
||||||
FILE *f;
|
FILE *f;
|
||||||
|
|
||||||
|
unlink("/tmp/snac-edit.txt");
|
||||||
system("$EDITOR /tmp/snac-edit.txt");
|
system("$EDITOR /tmp/snac-edit.txt");
|
||||||
|
|
||||||
if ((f = fopen("/tmp/snac-edit.txt", "r")) != NULL) {
|
if ((f = fopen("/tmp/snac-edit.txt", "r")) != NULL) {
|
||||||
@ -278,6 +279,11 @@ int main(int argc, char *argv[])
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
if (strcmp(url, "-") == 0) {
|
||||||
|
/* get the content from stdin */
|
||||||
|
content = xs_readall(stdin);
|
||||||
|
}
|
||||||
else
|
else
|
||||||
content = xs_dup(url);
|
content = xs_dup(url);
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user