Or Pd can recognize the "--" flag which disables command line parsing hereafter. I looked into this as it was helpful for debugging the sound file stuff and found it was an easy change to make. I just never formalized it for a PR etc.
On Jun 8, 2020, at 5:00 PM, pd-list-request@lists.iem.at wrote:
Date: Mon, 8 Jun 2020 15:12:34 +0100 From: Sebastian Lexer <s.lexer@incalcando.com mailto:s.lexer@incalcando.com> To: Pd-List <pd-list@lists.iem.at mailto:pd-list@lists.iem.at>, Christof Ressi <info@christofressi.com mailto:info@christofressi.com> Subject: Re: [PD] Pass arg to Pd via terminal Message-ID: 5ef354dd-97bc-4cbc-bc3b-a1df8c93fcae@Spark Content-Type: text/plain; charset="utf-8"
I like this idea very much! Could there be an argument flag? e.g.
$ pd mypatch.pd -a 23
Basically like terminal commands in sox, where the flags apply to import and output files dependent on the placement, in PD it could work as flags for PD before and in between the filename(s) to be opened.
Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com/ robotcowboy.com http://robotcowboy.com/
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
Christof
On 08.06.2020 17:09, Dan Wilcox wrote:
Or Pd can recognize the "--" flag which disables command line parsing hereafter. I looked into this as it was helpful for debugging the sound file stuff and found it was an easy change to make. I just never formalized it for a PR etc.
On Jun 8, 2020, at 5:00 PM, pd-list-request@lists.iem.at mailto:pd-list-request@lists.iem.at wrote:
Date: Mon, 8 Jun 2020 15:12:34 +0100 From: Sebastian Lexer <s.lexer@incalcando.com mailto:s.lexer@incalcando.com> To: Pd-List <pd-list@lists.iem.at mailto:pd-list@lists.iem.at>, Christof Ressi <info@christofressi.com mailto:info@christofressi.com> Subject: Re: [PD] Pass arg to Pd via terminal Message-ID: 5ef354dd-97bc-4cbc-bc3b-a1df8c93fcae@Spark Content-Type: text/plain; charset="utf-8"
I like this idea very much! Could there be an argument flag? e.g.
$Â pd mypatch.pd -a 23
Basically like terminal commands in sox, where the flags apply to import and output files dependent on the placement, in PD it could work as flags for PD before and in between the filename(s) to be opened.
Dan Wilcox @danomatika http://twitter.com/danomatika danomatika.com http://danomatika.com robotcowboy.com http://robotcowboy.com
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
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").
Agreed.
or should it be the other way round?
pd -args 'foo bar' -open "patch1.pd" -open "patch2.pd"
I tend to agree. It's also easier to parse.
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
Ugh... stateful command line options are ugly. What if you *don't* want to pass the arguments to subsequent patch files? I'd rather restrict the '-args' option to a single patch. But I'm not sure how to properly apply this to patch files provided as "just arguments". Maybe only allow it for patches opened with "-open"?
Christof
On 08.06.2020 20:52, IOhannes m zmölnig wrote:
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
Pd-list@lists.iem.at mailing list UNSUBSCRIBE and account-management -> https://lists.puredata.info/listinfo/pd-list