| 1676 | } |
| 1677 | |
| 1678 | static sds readArgFromStdin(void) { |
| 1679 | char buf[1024]; |
| 1680 | sds arg = sdsempty(); |
| 1681 | |
| 1682 | while(1) { |
| 1683 | int nread = read(fileno(stdin),buf,1024); |
| 1684 | |
| 1685 | if (nread == 0) break; |
| 1686 | else if (nread == -1) { |
| 1687 | perror("Reading from standard input"); |
| 1688 | exit(1); |
| 1689 | } |
| 1690 | arg = sdscatlen(arg,buf,nread); |
| 1691 | } |
| 1692 | return arg; |
| 1693 | } |
| 1694 | |
| 1695 | static void usage(void) { |
| 1696 | sds version = cliVersion(); |
no test coverage detected