Access to a branch point's current value?

0 views
Skip to first unread message

Greg Hanneman

unread,
Apr 2, 2013, 11:15:02 AM4/2/13
to ducttap...@googlegroups.com
Hey DuctTapers,

Sorry if this is a silly question, but I couldn't find an obvious answer in the tutorial documents:

Is it possible to have direct access to a branch point value (basically, a piece of the realization name) within a task?  Imagine I had a step like

task decode < in=(Extra: yes=$output@bigdata no=$output@smalldata)

I want this task to run for both settings of Extra, but I want to do have some different behavior within the task depending on what the current setting is.  Is there a way I can basically say "if Extra equals yes, then do ___; otherwise, do ___"?  The horrible hackish way I can think of would be to check the $in variable and see if its path includes "bigdata" or "smalldata", since those are task names...

Thanks!
Greg.

Nathan Schneider

unread,
Apr 2, 2013, 11:38:48 AM4/2/13
to Greg Hanneman, ducttap...@googlegroups.com

Greg,

The other way I know of (also slightly hacky) would be to introduce a parameter with the same branch point:

task decode < in=(Extra: yes=$output@bigdata no=$output@smalldata) :: extra=(Extra: yes no)

Because no explicit value is specified for the branches, the $extra variable will be "yes" or "no".

Nathan




Greg.

--
You received this message because you are subscribed to the Google Groups "ducttape-users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ducttape-user...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Jonathan Clark

unread,
Apr 2, 2013, 12:13:13 PM4/2/13
to Nathan Schneider, Greg Hanneman, ducttap...@googlegroups.com
Hey guys,

Nathan's solution is my preferred method of handling this. It seemed the cleanest way of doing this while still retaining an explicit correspondence to bash variables since bash isn't exactly object oriented.

-Jon
Reply all
Reply to author
Forward
0 new messages