[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r1422706 - in /subversion/trunk/subversion: libsvn_subr/opt.c tests/cmdline/svntest/main.py

From: Peter Samuelson <peter_at_p12n.org>
Date: Mon, 17 Dec 2012 13:44:43 -0600

[Stefan Sperling]
> We could use iatty() to enable --non-interactive if output is not
> going to a terminal, for instance.

I floated this idea some time ago and I'm still in favor of it. But I
think a simple isatty(STDERR_FILENO) would be wrong. What you want is
to detect that there is a controlling terminal at all - something like:

    #if WINDOWS
    #define CON "CON:"
    #else
    #define CON "/dev/tty"
    #endif
    fd = open(CON, O_RDWR);
    if (fd >= 0) {
        close(fd);
        ...
    }

(Of course I have no idea if "CON:" behaves that way. But there must
be _some_ way to determine, on Windows, whether you have a terminal
window available.)

Someone - was it Mark, perhaps? - objected to this idea on the basis
that some wrapper programs out there may try to "scrape" the prompts,
in interactive mode, and supply the correct input from, e.g., GUI
dialog boxes.

I feel like that's a blatant abuse of our interfaces and we shouldn't
support it, and if anyone really needs to do that they should use
'expect', but that's just an opinion and it isn't (yet) backed with any
code.
Received on 2012-12-17 20:45:27 CET

This is an archived mail posted to the Subversion Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.