You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by kf...@collab.net on 2005/07/11 20:10:47 UTC
Re: bug: --non-interactive is not global
Leo Savernik <l....@aon.at> writes:
> I'm not doubting the general principle at all. It's especially about the
> --non-interactive option which is automatically perceived as an inherently
> global option. To --non-interactive, the general principle doesn't apply, as
> you correctly state, because it will always mean the same for any command.
>
> Furthermore, any command disallowing --non-interactive is non-interactive by
> default, so there would be no contradiction in permitting --non-interactive
> even on those commands.
These are excellent points. I'm CC'ing dev@ here to see what other
developers say. Folks, Leo's proposal is to make all non-interactive
commands silently accept '--non-interactive', so that when writing
scripts one can just pass it promiscuously and not worry about whether
it's applicable or not. Above, he points out why '--non-interactive'
should be treated specially this way.
To implement it, I guess we'd handle it like we handle the '--help'
option, as in this code in subversion/clients/cmdline/main.c:
/* Check that the subcommand wasn't passed any inappropriate options. */
for (i = 0; i < received_opts->nelts; i++)
{
opt_id = APR_ARRAY_IDX (received_opts, i, int);
/* All commands implicitly accept --help, so just skip over this
when we see it. Note that we don't want to include this option
in their "accepted options" list because it would be awfully
redundant to display it in every commands' help text. */
if (opt_id == 'h' || opt_id == '?')
continue;
[...]
}
Thoughts? Anyone? Bueller?
-Karl
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: bug: --non-interactive is not global
Posted by Leo Savernik <l....@aon.at>.
Am Montag, 11. Juli 2005 23:46 schrieb Philip Martin:
> kfogel@collab.net writes:
> > Leo Savernik <l....@aon.at> writes:
> >> I'm not doubting the general principle at all. It's especially about the
> >> --non-interactive option which is automatically perceived as an
> >> inherently global option. To --non-interactive, the general principle
> >> doesn't apply, as you correctly state, because it will always mean the
> >> same for any command.
> >>
> >> Furthermore, any command disallowing --non-interactive is
> >> non-interactive by default, so there would be no contradiction in
> >> permitting --non-interactive even on those commands.
> >
> > These are excellent points. I'm CC'ing dev@ here to see what other
> > developers say. Folks, Leo's proposal is to make all non-interactive
> > commands silently accept '--non-interactive', so that when writing
> > scripts one can just pass it promiscuously and not worry about whether
> > it's applicable or not.
>
> Why is --non-interactive special? What about --no-auth-cache? The
> arguments could even apply to --username and --password?
My inquiry isn't about --no-auth-cache etc. It's merely about the fact that
--non-interactive is understood to be in effect for the whole executable
rather than per command.
Furthermore, --non-interactive will never have another meaning than
non-interactive.
>
> > Above, he points out why '--non-interactive'
> > should be treated specially this way.
>
> I'm don't really have any strong opions about the proposal, but I
> don't think the script argument is a strong one. Script's are
> generally "write once, use many" so I don't see why they should not be
> written to pass the correct arguments.
Well, my script used to cope only with cvs. Now, it has to cope with svn, too,
while providing the same interface to the caller (this is important, because
this script is used by other scripts).
>
> Perhaps we should allow non-interactive to be set in the config file
> instead?
In this case I'm going to resort to the same hack as for cvsup, writing out a
temporary config file on the fly.
mfg
Leo
Re: bug: --non-interactive is not global
Posted by Leo Savernik <l....@aon.at>.
Am Montag, 11. Juli 2005 23:46 schrieb Philip Martin:
> kfogel@collab.net writes:
> > Leo Savernik <l....@aon.at> writes:
> >> I'm not doubting the general principle at all. It's especially about the
> >> --non-interactive option which is automatically perceived as an
> >> inherently global option. To --non-interactive, the general principle
> >> doesn't apply, as you correctly state, because it will always mean the
> >> same for any command.
> >>
> >> Furthermore, any command disallowing --non-interactive is
> >> non-interactive by default, so there would be no contradiction in
> >> permitting --non-interactive even on those commands.
> >
> > These are excellent points. I'm CC'ing dev@ here to see what other
> > developers say. Folks, Leo's proposal is to make all non-interactive
> > commands silently accept '--non-interactive', so that when writing
> > scripts one can just pass it promiscuously and not worry about whether
> > it's applicable or not.
>
> Why is --non-interactive special? What about --no-auth-cache? The
> arguments could even apply to --username and --password?
My inquiry isn't about --no-auth-cache etc. It's merely about the fact that
--non-interactive is understood to be in effect for the whole executable
rather than per command.
Furthermore, --non-interactive will never have another meaning than
non-interactive.
>
> > Above, he points out why '--non-interactive'
> > should be treated specially this way.
>
> I'm don't really have any strong opions about the proposal, but I
> don't think the script argument is a strong one. Script's are
> generally "write once, use many" so I don't see why they should not be
> written to pass the correct arguments.
Well, my script used to cope only with cvs. Now, it has to cope with svn, too,
while providing the same interface to the caller (this is important, because
this script is used by other scripts).
>
> Perhaps we should allow non-interactive to be set in the config file
> instead?
In this case I'm going to resort to the same hack as for cvsup, writing out a
temporary config file on the fly.
mfg
Leo
Re: bug: --non-interactive is not global
Posted by Philip Martin <ph...@codematters.co.uk>.
kfogel@collab.net writes:
> Leo Savernik <l....@aon.at> writes:
>> I'm not doubting the general principle at all. It's especially about the
>> --non-interactive option which is automatically perceived as an inherently
>> global option. To --non-interactive, the general principle doesn't apply, as
>> you correctly state, because it will always mean the same for any command.
>>
>> Furthermore, any command disallowing --non-interactive is non-interactive by
>> default, so there would be no contradiction in permitting --non-interactive
>> even on those commands.
>
> These are excellent points. I'm CC'ing dev@ here to see what other
> developers say. Folks, Leo's proposal is to make all non-interactive
> commands silently accept '--non-interactive', so that when writing
> scripts one can just pass it promiscuously and not worry about whether
> it's applicable or not.
Why is --non-interactive special? What about --no-auth-cache? The
arguments could even apply to --username and --password?
> Above, he points out why '--non-interactive'
> should be treated specially this way.
I'm don't really have any strong opions about the proposal, but I
don't think the script argument is a strong one. Script's are
generally "write once, use many" so I don't see why they should not be
written to pass the correct arguments.
Perhaps we should allow non-interactive to be set in the config file
instead?
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@subversion.tigris.org
For additional commands, e-mail: users-help@subversion.tigris.org
Re: bug: --non-interactive is not global
Posted by Philip Martin <ph...@codematters.co.uk>.
kfogel@collab.net writes:
> Leo Savernik <l....@aon.at> writes:
>> I'm not doubting the general principle at all. It's especially about the
>> --non-interactive option which is automatically perceived as an inherently
>> global option. To --non-interactive, the general principle doesn't apply, as
>> you correctly state, because it will always mean the same for any command.
>>
>> Furthermore, any command disallowing --non-interactive is non-interactive by
>> default, so there would be no contradiction in permitting --non-interactive
>> even on those commands.
>
> These are excellent points. I'm CC'ing dev@ here to see what other
> developers say. Folks, Leo's proposal is to make all non-interactive
> commands silently accept '--non-interactive', so that when writing
> scripts one can just pass it promiscuously and not worry about whether
> it's applicable or not.
Why is --non-interactive special? What about --no-auth-cache? The
arguments could even apply to --username and --password?
> Above, he points out why '--non-interactive'
> should be treated specially this way.
I'm don't really have any strong opions about the proposal, but I
don't think the script argument is a strong one. Script's are
generally "write once, use many" so I don't see why they should not be
written to pass the correct arguments.
Perhaps we should allow non-interactive to be set in the config file
instead?
--
Philip Martin
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org