Coder Social home page Coder Social logo

Comments (7)

casey avatar casey commented on September 3, 2024

Yah, this is definitely annoying.

I would have actually liked to have different recipes be tab separated in the output of just --summary, so that recipes in modules could be space separated, i.e., if there's a recipe foo and a recipe bar in module baz, just --summary would output foo\tbar\sbaz, so then you could split on tabs to the valid recipes. Unfortunately, this would break any scripts which relied on splitting the output of just --summary on spaces, or on whitespace, so I opted to use the :: syntax instead. Eventually, when recipes can have dependencies that are in other modules, I'll probably wind up using the same syntax for dependencies:

mod baz

foo: baz::bar

I'm not opposed to adding foo::bar as an additional syntax to call recipes in modules from the command line. It seems a bit inelegant to add it just to make the lives of completion scripts easier, but I think some people will prefer that syntax anyhow, and if it becomes the actual syntax for dependencies in other modules, being able to use that syntax on the command line makes sense.

from just.

casey avatar casey commented on September 3, 2024

Another thing that the completion scripts could do is split on ::, but I have basically never touched the completion scripts personally, and always left them to other brave souls, so I don't know how annoying this would be to do.

from just.

crdx avatar crdx commented on September 3, 2024

Differentiating between spaces and tabs in completion results sounds messy to me, and like you said, probably backwards-incompatible.

Developers tend to be used to the concept of namespace separators, and :: is a common one.

In the past I've wanted to use : to create categories of recipe, e.g. make:migration but couldn't because : is not valid in a recipe name. I would use this feature to put all the make recipes in make.just and reference them as a module, which would tidy things up.

Unfortunately if invoking module recipes by :: became the only way, the output of just --list would probably need to change from the neat tabbed output to a flat list with module recipes listed as foo::bar, otherwise it wouldn't be clear how to invoke them.

Not sure what's best either way, so just sharing my thoughts.

from just.

crdx avatar crdx commented on September 3, 2024

Unfortunately, this would break any scripts which relied on splitting the output of just --summary on spaces

Not sure if that'd be something worth doing as (at least with bash) it's not the completion script's job to split up the input:

https://www.gnu.org/software/bash/manual/html_node/Bash-Variables.html#index-COMP_005fWORDS

It does mention COMP_WORDBREAKS but imo completions are fragile enough even without trying to change the defaults.

from just.

casey avatar casey commented on September 3, 2024

Unfortunately if invoking module recipes by :: became the only way, the output of just --list would probably need to change from the neat tabbed output to a flat list with module recipes listed as foo::bar, otherwise it wouldn't be clear how to invoke them.

I'd definitely allow both :: separated and space separated from the command line, since I personally like space-separated, and space is one character, whereas :: is two characters, and requires shift.

Not sure if that'd be something worth doing as (at least with bash) it's not the completion script's job to split up the input:

Ahh, good catch. So I guess separating by tabs wouldn't work anyway.

from just.

casey avatar casey commented on September 3, 2024

Fixed in #1809, recipes can now be invoked on the command line with path syntax, i.e., foo::bar.

from just.

crdx avatar crdx commented on September 3, 2024

Nice. Thanks.

from just.

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.