aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorqorg11 <qorg@vxempire.xyz>2021-06-15 16:23:29 +0200
committerqorg11 <qorg@vxempire.xyz>2021-06-15 16:23:29 +0200
commit144749aabbd31494e4b90bb165f4098ab7eae1d9 (patch)
treed031efffadec20a344e64813810a6291663e9c25
parentdf2bc5889884eae0793ee862c00d11c47a29d504 (diff)
downloaddemiurge-144749aabbd31494e4b90bb165f4098ab7eae1d9.tar.gz
demiurge-144749aabbd31494e4b90bb165f4098ab7eae1d9.zip
Thing can now read from stdin
-rw-r--r--.gitignore2
-rw-r--r--src/main.c10
2 files changed, 12 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index 2d4cf80..0b70518 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,3 +1,5 @@
.demiurgerc
src/.demiurgerc
*.o
+*.d
+demiurge \ No newline at end of file
diff --git a/src/main.c b/src/main.c
index 486df78..442446d 100644
--- a/src/main.c
+++ b/src/main.c
@@ -30,6 +30,16 @@ main(int argc, char **argv)
char *status = NULL;
char *visibility = NULL;
char *id_ptr = NULL;
+
+ /* TODO: Support filename and visibility */
+
+ if(!isatty(0)) {
+ eputs("Not a terminal, reading from stdin");
+ char *status = readline("");
+ post_status(status,NULL,NULL);
+ return 0;
+ }
+
if(argc == 1) {
usage(argv[0]);
return -1;