Feature Request: Use `<` and `>` for primary input/output #39

Closed
Zearin opened this Issue Apr 2, 2012 · 8 comments

Comments

Projects
None yet
2 participants
@Zearin

Zearin commented Apr 2, 2012

The Current Usage

Either:

$ calabash -i[port] input_file.xml -o[port] output_file.xml pipeline.xpl

Or:

$ calabash --input source=input_file.xml --output result=output_file.xml pipeline.xpl

(I have a script, /usr/local/bin/calabash, to take care of all the command-line Java weirdness that I am seemingly incapable of remembering no matter how many times I look it up. ☺)

The Ideal Usage

Since XProc requires one primary input and one primary output, would it be possible to support using standard *nix redirect characters to specify the primary I/O ports? (< and > respectively)

Example:

$ calabash < input_file.xml > output_file.xml pipeline.xpl

The idea seems very appealing to me somehow.

What about sequences?

A couple of ideas come to mind:

  • Allow glob syntax (*.xml) to specify multiple input files
  • Use quotes to specify multiple I/O files < "input1.xml input2.xml"
  • Allow directories for output…(?) (Just throwing out ideas: > ./dir/*.xml)
  • An error is printed if one of the above cannot be unambiguously determined, listing the primary I/O ports that are sequences

Benefits

  • Brevity of typing
  • More “at home” feeling for non-Java devs that use Calabash in their scripts
  • I’m guessing that people smarter at shell scripting than me could possibly come up with some other ingenious uses ☺
@ndw

This comment has been minimized.

Show comment
Hide comment
@ndw

ndw Apr 2, 2012

Owner

You can do that. Sort of. The magic filename "-" stands for STDIN or STDOUT.

calabash -isource=- -oresult=- < input_file.xml > output_file.xml pipeline.xpl

Is that sufficient for your needs, or would you really like it to be totally implicit: if there's no binding for the primary input port, assume it's STDIN. (I think STDOUT is already handled this way.)

I don't think that would be unreasonable.

Owner

ndw commented Apr 2, 2012

You can do that. Sort of. The magic filename "-" stands for STDIN or STDOUT.

calabash -isource=- -oresult=- < input_file.xml > output_file.xml pipeline.xpl

Is that sufficient for your needs, or would you really like it to be totally implicit: if there's no binding for the primary input port, assume it's STDIN. (I think STDOUT is already handled this way.)

I don't think that would be unreasonable.

@Zearin

This comment has been minimized.

Show comment
Hide comment
@Zearin

Zearin Apr 3, 2012

@ndw : Yep, implicit STDIN would be awesome!

Since I’m not a command-line guru, I just want to make sure: implicit STDIN means I could pipe things into calabash, or use < some-file.xml to specify the input—right?

Zearin commented Apr 3, 2012

@ndw : Yep, implicit STDIN would be awesome!

Since I’m not a command-line guru, I just want to make sure: implicit STDIN means I could pipe things into calabash, or use < some-file.xml to specify the input—right?

@ndw

This comment has been minimized.

Show comment
Hide comment
@ndw

ndw May 16, 2012

Owner

Yes. And because I think STDOUT is already handled that way, I'll try to get this into the next release.

Owner

ndw commented May 16, 2012

Yes. And because I think STDOUT is already handled that way, I'll try to get this into the next release.

@Zearin

This comment has been minimized.

Show comment
Hide comment
@Zearin

Zearin Jun 4, 2012

Ping ☺

Just curious if/how this is doing.

Zearin commented Jun 4, 2012

Ping ☺

Just curious if/how this is doing.

@ndw

This comment has been minimized.

Show comment
Hide comment
@ndw

ndw Jun 4, 2012

Owner

It's on my list. There's a performance/memory leak bug that I've given a slightly higher priority. And I've been distracted by my day job and other things just recently.

Owner

ndw commented Jun 4, 2012

It's on my list. There's a performance/memory leak bug that I've given a slightly higher priority. And I've been distracted by my day job and other things just recently.

@Zearin

This comment has been minimized.

Show comment
Hide comment
@Zearin

Zearin Aug 14, 2012

(re) Ping! ☺

Zearin commented Aug 14, 2012

(re) Ping! ☺

@ndw

This comment has been minimized.

Show comment
Hide comment
@ndw

ndw Jan 29, 2013

Owner

Fixed for 1.0.6, I believe.

Owner

ndw commented Jan 29, 2013

Fixed for 1.0.6, I believe.

@Zearin

This comment has been minimized.

Show comment
Hide comment
@Zearin

Zearin Jan 29, 2013

w00t w00t w00t!

Thanks, Norm! 😄

Zearin commented Jan 29, 2013

w00t w00t w00t!

Thanks, Norm! 😄

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment