Re: An unfulfilled requirement maybe?

/ Vasil Rangelov <boen.robot@gmail.com> was heard to say:
|> I prototyped a slightly different model:
|>
|> <p:declare-step type="px:exec">
|>  <p:input port="stdin"/>
|>  <p:output port="stdout" primary="true"/>
|>  <p:output port="stderr"/>
|>  <p:option name="command" required="true"/>
|>  <p:option name="args"/>
|>  <p:option name="wrap-stdout-lines" value="false"/>
|>  <p:option name="wrap-stderr-lines" value="false"/>
|> </p:declare-step>
|>
|> It seems to work pretty well, naming aside.
|
| I can't figure this out... what and how goes in the input port? I mean, how
| is the application and/or CLI connected to the input port?

An XML document goes in the input port and it's connected to stdin on the
program that runs.

I'm tempted to special case an empty binding to stdin.

| If "command" is suppose to contain the full command (i.e. the path to the
| program and it's arguments), what does the "args" option carry? If "command"
| is supposed to be only the program's location... why? And that "command"
| would be a misleading name in that case is another question.

Yeah, maybe it'd be better to just make command the whole command line,
in which case...maybe it should be called command-line :-)

| I assume both output ports will have <c:result/> elements with <c:line/>
| elements (if not prohibited by the wrap-*-lines options of course), right?

Yes.

| What happens if a program has only errors? Is the primary output port still
| populated and if not, wouldn't that cause the step to fail (even though
| there's contents in the error stream)? Would making it non-primary solve
| this?

The way I coded it up, you get an empty c:result on the output port if
that output produced ... no output. I suppose it might be possible to make
it return an empty sequence instead, but I'd rather not.

                                        Be seeing you,
                                          norm

-- 
Norman Walsh <ndw@nwalsh.com> | Everything should be made as simple as
http://nwalsh.com/            | possible, but no simpler.

Received on Sunday, 30 September 2007 13:26:13 UTC