| 1865 | } |
| 1866 | |
| 1867 | static sds readArgFromStdin(void) { |
| 1868 | char buf[1024]; |
| 1869 | sds arg = sdsempty(); |
| 1870 | |
| 1871 | while(1) { |
| 1872 | int nread = read(fileno(stdin),buf,1024); |
| 1873 | |
| 1874 | if (nread == 0) break; |
| 1875 | else if (nread == -1) { |
| 1876 | perror("Reading from standard input"); |
| 1877 | exit(1); |
| 1878 | } |
| 1879 | arg = sdscatlen(arg,buf,nread); |
| 1880 | } |
| 1881 | return arg; |
| 1882 | } |
| 1883 | |
| 1884 | static void usage(void) { |
| 1885 | sds version = cliVersion(); |
no test coverage detected