GithubHelp home page GithubHelp logo

Comments (5)

jeffbaumes avatar jeffbaumes commented on July 18, 2024

The only thing I don't like is that it requires you to make the id of the input name start with --.

I could see two ways to separate these concerns. One is that you make $flag take two inputs, the input id and the flag name. The other is to move some command argument logic to the input spec, so that there is both an id and an arg variable to help construct the flag (arg could default to '--' + id). I also could see the --input_name=$input{input_name} pattern repeated often, and the arg field with something like $option{input_name} that expands to the that pattern could handle that common case more cleanly.

from girder_worker.

jeffbaumes avatar jeffbaumes commented on July 18, 2024

As more syntactic sugar, it may be nice to add a single macro $all which expands to $option{id1} $option{id2} ... for all inputs in order. Probably would make sense to use $flag{id} for boolean inputs. There shouldn't be inputs that aren't reflected in the command line arguments to docker, so I expect this would cover many use cases.

from girder_worker.

zachmullen avatar zachmullen commented on July 18, 2024

I like the second proposal; in my first pass at this, I was just using id and name to distinguish between how it is passed on the command line (with dashes) versus how it is displayed to users. But having another, more explicit field for this in the task input would be better, e.g.:

id: "MyFlag"
name: "MyFlag"
flag: "--my-flag"
type: "boolean"
format: "boolean"

and if the flag field is not set, we can fall back to the id. Sound reasonable?

from girder_worker.

jeffbaumes avatar jeffbaumes commented on July 18, 2024

This is a good solution for flag, but if we ever implement the other syntactic sugar I suggested, it may be good to call the key something more generic (arg or something similar) so other non-boolean inputs could describe themselves as well.

from girder_worker.

zachmullen avatar zachmullen commented on July 18, 2024

Good point, I'll use arg then.

from girder_worker.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.