[PD] Pass arg to Pd via terminal

IOhannes m zmölnig zmoelnig at iem.at
Mon Jun 8 20:52:56 CEST 2020


On 6/8/20 5:49 PM, Christof Ressi wrote:
> The thing is that we can load more than one patch. I think something
> like this could work:
> 
> pd patch1.pd -a "1 2 3" patch2.pd -a "foo bar"
> 
> But we could move the bikeshedding to GitHub ;-)
> https://github.com/pure-data/pure-data/issues/1058
> 


actually i think that a mailinglist is much better suited for the
bikeshedding tour.

at least for me, i tend to apply a " closed-for-me" tag to all those
issues that have a very high noise-to-signal ratio (and there are quite
a couple of those).
the non-threaded nature of the issues makes it virtually impossible to
keep track of divergent opinions.

so:
> pd patch1.pd -a "1 2 3" patch2.pd -a "foo bar"

urgh, no.
this breaks th eexpectations of cmdline processing (a separation between
options with arguments (e.g. '-a "1 2 3"') and 'just arguments"
("patch1.pd patch2.pd"). i think this separation is quite universal in
un*x like environments, and i don't see any compelling reason to
actually break it.

o a more consistent way would be:
> pd -open patch1.pd -args "1 2 3" -open "patch2.pd" -args "foo bar"

or should it be the other way round?
> pd -args 'foo bar' -open "patch1.pd" -open "patch2.pd"

the inspiration for this is the dollar-expansion in message-boxes.

it has the advantage that you can pass the same arguments to multiple
(or all) patches.
it also makes it quite easy to keep compatibility with the "the rest of
the arguments are files" paradigm:
> pd -args 24 foo.pd bar.pd


gsamdr
IOhannes

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 833 bytes
Desc: OpenPGP digital signature
URL: <http://lists.puredata.info/pipermail/pd-list/attachments/20200608/3eb6213e/attachment.sig>


More information about the Pd-list mailing list