[Iplant-api-dev] Questions about passing boolean variable from DE to api

Sheldon McKay sheldon.mckay at gmail.com
Fri Aug 2 07:12:13 MST 2013


As best I can understand, the DE treats BOOLEANS as command line flags,
where present = true and absent = false.



On Thu, Aug 1, 2013 at 7:10 PM, Barthelson, Roger A - (rogerab) <
rogerab at email.arizona.edu> wrote:

> I think for the booleans in the DE, if you put in --x=true for the
> argument, then that is what enters the command line, in effect or as you
> saw, the alternative is that you get nothing.
>
> Roger
>
>
> Roger Barthelson Ph.D.
> Scientific Analyst
> iPlant Collaborative
> BIO5 Institute, University of Arizona
> Phone: 520-977-5249
> Email: rogerab at email.arizona.edu
> Web: www.iplantcollaborative.org/
>            bio-it.arizona.edu/Roger_Barthelson_Home.html
>
>
>
>
>
>
> On 8/1/13 3:46 PM, "Wang, Liya" <wangli at cshl.edu> wrote:
>
> >Roger,
> >
> >Thanks. I might need to explain it better.
> >
> >For the current DE, if x is true, it will be passed as empty. If x is
> >false, it will be ignored so that it will not appear in the command line
> >in iplant.sh.
> >
> >I am not sure how the API adapter is coded to handle this but none of the
> >approaches I tried actually works.
> >
> >Liya
> >On Aug 1, 2013, at 5:49 PM, "Barthelson, Roger A - (rogerab)"
> ><rogerab at email.arizona.edu>
> > wrote:
> >
> >> For something like that, I usually just put in if statements:
> >>
> >> e.g.
> >> if [ "${x}" == true ];
> >> then
> >> OPT="$OPT -r true";
> >> fi
> >> if [ "${$x}" != true];
> >> then
> >> OPT="$OPT -r false";
> >> fi
> >>
> >>
> >> In this example, I use $OPT to contain any or all options. So the
> >> executable statement can be something like velveth $OPT $input. I set
> >>some
> >> option "-r" to true or false, but this can be used to take care of any
> >> truly optional option. If that makes sense.
> >>
> >> Roger
> >>
> >>
> >> Roger Barthelson Ph.D.
> >> Scientific Analyst
> >> iPlant Collaborative
> >> BIO5 Institute, University of Arizona
> >> Phone: 520-977-5249
> >> Email: rogerab at email.arizona.edu
> >> Web: www.iplantcollaborative.org/
> >>           bio-it.arizona.edu/Roger_Barthelson_Home.html
> >>
> >>
> >>
> >>
> >>
> >>
> >> On 8/1/13 2:19 PM, "Wang, Liya" <wangli at cshl.edu> wrote:
> >>
> >>> Hi all,
> >>>
> >>> It seems that boolean variables are handled differently from DE. For
> >>> example, if I have variable x with value 'true', it will be passed as
> >>> '--x='. Otherwise, it will be ignored.
> >>>
> >>> I was expecting that it will be passed as '--x=true' or '--x=false'.
> >>>Any
> >>> idea how to handle this in the shell wrapper script?
> >>>
> >>> Thanks,
> >>> Liya
> >>>
> >>>
> >>> _______________________________________________
> >>> Iplant-api-dev Mailing List: Iplant-api-dev at iplantcollaborative.org
> >>> List Info and Archives:
> >>> http://mail.iplantcollaborative.org/mailman/listinfo/iplant-api-dev
> >>> One-click Unsubscribe:
> >>>
> >>>
> http://mail.iplantcollaborative.org/mailman/options/iplant-api-dev/roger
> >>>ab
> >>> %40email.arizona.edu?unsub=1&unsubconfirm=1
> >>
> >
>
>
> _______________________________________________
> Iplant-api-dev Mailing List: Iplant-api-dev at iplantcollaborative.org
> List Info and Archives:
> http://mail.iplantcollaborative.org/mailman/listinfo/iplant-api-dev
> One-click Unsubscribe:
> http://mail.iplantcollaborative.org/mailman/options/iplant-api-dev/mckays%40cshl.edu?unsub=1&unsubconfirm=1
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.iplantcollaborative.org/pipermail/iplant-api-dev/attachments/20130802/bdc149e9/attachment-0001.html 


More information about the Iplant-api-dev mailing list