[RFC][Bug #40983] Loading of command-line arguments from a file
John Arbash Meinel
john at arbash-meinel.com
Tue Nov 20 21:42:10 GMT 2007
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
Daniel Watkins wrote:
> Bug #40983[0] is a feature request for SVN --targets-like reading of
> command line arguments from a file. This is to get around problems
> with the maximum numbers of arguments in shells.
>
> Two ways of doing this occur to me:
> 1) In each command that requires it, add specific functionality
> (presumably with all of them using a helper function to do the heavy
> lifting).
> 2) Make this a global option and treat each line as a separate
> command-line argument, meaning it can be passed to any command.
>
> (1) seems to make more sense than (2) to me, but I thought I'd get some
> feedback so I don't spend some time this weekend working on a patch
> only for it to be suggested that I should do it the opposite way.
>
I personally prefer (2). I don't see a need for every command to re-implement
option parsing.
I don't think we need to do one per line, though that is an option. We could
just as easily do something like:
args = args + shlex.split(' '.join(s.strip() for s in f.readlines())
(this isn't 100% correct, because you need to watch out for encoding with
shlex.split()) We like our args in Unicode when possible, but shlex only
supports 8-bit strings.
John
=:->
>
> Dan
>
> [Footnote 0: https://bugs.edge.launchpad.net/bzr/+bug/40983]
>
(By the way, only users in the 'beta-testers' group see the '.edge.' pages. So
you should try to edit it out of your links. Arguably since LP auto-redirects
users from bugs.launchpad.net => bugs.edge.launchpad.net, it should
auto-redirect non-members from *.edge.launchpad.net => *.launchpad.net.)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.7 (Darwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHQ1SxJdeBCYSNAAMRAnW2AKCmIIiROgsScvvag3Qk8XdXVE9/2gCfUDbP
9Jl+ExtUn0Qt6CCUvnJuvpM=
=0+95
-----END PGP SIGNATURE-----
More information about the bazaar
mailing list