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

Allow multiline task definitions (or document how to use them, if they are already allowed) #147

Open
matt-gardner opened this issue Feb 4, 2013 · 4 comments

Comments

@matt-gardner
Copy link

For terminal editing, keeping lines to a maximum of 80 characters can be very important. If there are a lot of parameters that a particular task needs to use, it is easy to exceed the 80 character line limit, making terminal editing a pain. It would be nice if ducttape allowed multiline task definitions. An example follows.

Task definition:

task RunInference :: base=@ main_class=@ kb_file=@ sem_params=@ kb=@ iters=@
mem=@ num_docs=@ output_dir=@ num_threads=@ {

Gives this error:

ERROR: Missing opening { brace for task block.
/home/mg1/clone/OntologyLearner/entity_linking_ducttape/entity_linking.tape:6
mem=@ num_docs=@ output_dir=@ num_threads=@ {

Second try, trying to escape the newline with a backslash:

ERROR: Illegal character at start of parameter variable name
/home/mg1/clone/OntologyLearner/entity_linking_ducttape/entity_linking.tape:5
task RunInference :: base=@ main_class=@ kb_file=@ sem_params=@ kb=@ iters=@ \

@dowobeha
Copy link
Collaborator

dowobeha commented Feb 4, 2013

Multi-line task definitions are allowed.

However, at the start of each new line, you need to re-specify :: or < or

.

The following should work:

task RunInference :: base=@ main_class=@ kb_file=@ sem_params=@ kb=@ iters=@
:: mem=@ num_docs=@ output_dir=@ num_threads=@ {

@matt-gardner
Copy link
Author

Thanks, that did indeed work. Is there a place where this is or should be
documented?

On Mon, Feb 4, 2013 at 11:02 AM, Lane Schwartz [email protected]:

Multi-line task definitions are allowed.

However, at the start of each new line, you need to re-specify :: or < or

.

The following should work:

task RunInference :: base=@ main_class=@ kb_file=@ sem_params=@ kb=@
iters=@
:: mem=@ num_docs=@ output_dir=@ num_threads=@ {


Reply to this email directly or view it on GitHubhttps://github.com//issues/147#issuecomment-13083611.

@dowobeha
Copy link
Collaborator

dowobeha commented Feb 4, 2013

Yes, this should be documented, but I don't know where. I haven't done much
with the documentation.

@jhclark
Copy link
Owner

jhclark commented May 15, 2014

Either put this in https://github.com/jhclark/ducttape/blob/master/tutorial/01-11-shorthand-variables.tape or make a new file for it in that directory.

*.tape in the tutorial directory automatically gets compiled into https://github.com/jhclark/ducttape/blob/master/tutorial/TUTORIAL.md (and a LaTeX file) by https://github.com/jhclark/ducttape/blob/master/build-support/doc.sh

All of those files are also tested for non-zero exit codes by https://github.com/jhclark/ducttape/blob/master/build-support/test-regression.sh. So that the tutorial is guaranteed to compile.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants