casey / just

🤖 Just a command runner
https://just.systems
Creative Commons Zero v1.0 Universal
20.3k stars 450 forks source link

[alias] attribute #2349

Open casey opened 2 weeks ago

casey commented 2 weeks ago

PR #2344 added a new attribute, [alias] providing an alternative way for declaring recipe aliases. I personally lean towards not adding a new attribute, but I don't feel super strongly, so if it's something that people wanted, I wouldn't mind adding it.

I think ideally, would take a string literal: [alias: "foo"], which would initially be constrained to be a valid identifier. This could be relaxed in the future to allow non-identifier aliases.

See the original PR for some of the discussion.

runeimp commented 1 week ago

I like the idea of keeping all parts of a recipe in one place. Especially when considering modules, etc.

marcaddeo commented 1 week ago

@casey I'm not sure if you had a chance to fully review the original PR, but my first commit is my first attempt in which I tried to use the [alias("string")] syntax.

I wasn't liking how the code turned out, and felt like I was fighting Just to implement it. That's why I moved to using Identifiers/Names/Tokens (not sure which is the most technically correct qualifier here 😄), and because aliases are already processed that way.

I've made a couple more attempts at implementing it with strings, but haven't been successful.

Would love to make another attempt and get this feature eventually merged, but if you could possibly point me in the right direction for implementing this with strings (if you've got any ideas for it) that would be super helpful.

casey commented 1 week ago

I'm still honestly not totally sold on this feature, since it feels like it just duplicates the existing way of creating aliases. just is already pretty bloated 😅 Although in some ways that's what makes it a nice tool. So I don't want to send you off trying to get strings to work if it won't ultimately get merged. I think I'm inclined to let this issue sit for a bit before acting on it, to get some more feedback.