ducttape
ducttape copied to clipboard
Allow multiline task definitions (or document how to use them, if they are already allowed)
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=@ \
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=@ {
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/jhclark/ducttape/issues/147#issuecomment-13083611.
Yes, this should be documented, but I don't know where. I haven't done much with the documentation.
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.