Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

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

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

Zearin opened this issue Apr 2, 2012 · 8 comments

Comments

@Zearin
Copy link

@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
Copy link
Owner

@ndw 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
Copy link
Author

@Zearin 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
Copy link
Owner

@ndw 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
Copy link
Author

@Zearin Zearin commented Jun 4, 2012

Ping

Just curious if/how this is doing.

@ndw
Copy link
Owner

@ndw 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
Copy link
Author

@Zearin Zearin commented Aug 14, 2012

(re) Ping!

@ndw
Copy link
Owner

@ndw ndw commented Jan 29, 2013

Fixed for 1.0.6, I believe.

@Zearin
Copy link
Author

@Zearin 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
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
You can’t perform that action at this time.