ndb/dnsquery, ndb/csquery: write ">" prompt to stderr (thanks kvik)
kvik writes: dnsquery(8) prints the interactive prompt on stdout together with query results, making scripted usage unnecessarily difficult. A straightforward solution is prompting on stderr instead: as practiced by rc(1), among many others -- promptly taking care of the issue: ; echo 9front.org mx | ndb/dnsquery >[2]/dev/null
This commit is contained in:
parent
a6fde3edc5
commit
4b9ccb2de0
2 changed files with 2 additions and 2 deletions
|
@ -68,7 +68,7 @@ main(int argc, char **argv)
|
|||
|
||||
Binit(&in, 0, OREAD);
|
||||
for(;;){
|
||||
print("> ");
|
||||
fprint(2, "> ");
|
||||
p = Brdline(&in, '\n');
|
||||
if(p == 0)
|
||||
break;
|
||||
|
|
|
@ -58,7 +58,7 @@ query(int fd)
|
|||
Biobuf in;
|
||||
|
||||
Binit(&in, 0, OREAD);
|
||||
for(print("> "); lp = Brdline(&in, '\n'); print("> ")){
|
||||
for(fprint(2, "> "); lp = Brdline(&in, '\n'); fprint(2, "> ")){
|
||||
n = Blinelen(&in) -1;
|
||||
while(isspace(lp[n]))
|
||||
lp[n--] = 0;
|
||||
|
|
Loading…
Reference in a new issue