Replies: 16 comments
-
It could also be cool to add a run-as option of |
Beta Was this translation helpful? Give feedback.
-
I'm not sure if we should re-invent the clojure CLI, but I think it would be powerful if neil offered some short-hands for things you can install with neil. E.g.:
and then
would translate into
And similar for |
Beta Was this translation helpful? Give feedback.
-
I agree that
? Or just |
Beta Was this translation helpful? Give feedback.
-
Implemented |
Beta Was this translation helpful? Give feedback.
-
@borkdude @didibus: The When we add things like Consider someone who is learning Clojure today. They can't avoid the |
Beta Was this translation helpful? Give feedback.
-
I agree. So something like |
Beta Was this translation helpful? Give feedback.
-
Another suggestion: To expand on this, maybe |
Beta Was this translation helpful? Give feedback.
-
I think typing Btw, I do see a benefit in having arguments run through babashka.cli first before they are passed to the clojure CLI, since the clojure CLI demands you to quote things as EDN first which is problematic for some people (on Windows, but also when you use E.g. |
Beta Was this translation helpful? Give feedback.
-
Yeah, I think you're right. It even takes more characters! So with that in mind, my stance is that people should run their tasks directly with
That makes sense. I think if there was one command that did this for all possible invocations of |
Beta Was this translation helpful? Give feedback.
-
I think it would even make more sense if we supported:
vs
and neil picked the most recent version by default. So, not only transpiling, but also offering some convenience. |
Beta Was this translation helpful? Give feedback.
-
and once that's supported, perhaps:
where So: not only a simple transpilation, but convenience which justifies this feature. |
Beta Was this translation helpful? Give feedback.
-
Another idea: # Equivalent commands
# Note: `neil new` doesn't use the `clj` command, but the output should be the same
$ neil new app my-app --foo 1 --bar 2
$ neil clj -Tnew app my-app --foo 1 --bar 2
$ clj -Tnew app my-app :foo 1 :bar 2
# Equivalent commands
$ neil tool install io.github.seancorfield/deps-new --as new
$ neil tool install io.github.seancorfield/deps-new --git/tag v0.4.13 --as new
$ neil clojure -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.4.13"}' --as new
$ clojure -Ttools install io.github.seancorfield/deps-new '{:git/tag "v0.4.13"}' :as new In this example, the sole purpose of the For abstractions on top of |
Beta Was this translation helpful? Give feedback.
-
One issue I see with Clojure CLI is that running an alias is kind of complicated. You have to figure out if it's supposed to be used with -X or -T or -T: or -M, which means you almost always have to inspect the deps.edn to remember how to call the alias. And then even if you know how to call it, the invokation is extra long and cryptic and escaping options is more difficult than standard Unix. This is why you added But instead of eventually adding a special command for every common alias that comes into existence so that beginners have an easier way to remember and call those aliases. Why not make it generic that all aliases automatically becomes neil commands? Say I want to add
Alternatively I create an issue in neil and ask to add I still think it makes sense to have the most common aliases lifted into |
Beta Was this translation helpful? Give feedback.
-
An alias can support both -X and -M. In fact, the test alias added by neil can be run in both ways. So there is no automatic way of detecting that. I think standardizing the way neil behaves is the best way forward. |
Beta Was this translation helpful? Give feedback.
-
That's true, but like I mentioned, it could either prompt or we can use an extra key on the alias to specify which one neil should use like so:
It's possible as well. I was hoping more for a Clojure CLI but with better command line UX. But also possibly if neil just covers 99% of all common commands just in a standard way it brings most of the same benefits with less effort and complexity, because then I only need to reach for Clojure CLI in exceptional cases. As always, I trust your judgement. |
Beta Was this translation helpful? Give feedback.
-
From 0.1.43 on neil saves data in |
Beta Was this translation helpful? Give feedback.
-
Proposal
I was thinking it could be nice if:
neil command
Would be smart enough to look at the deps.edn, lookup an alias for
command
, and figure out if it needs to be called with-X
or-M
or-T
, and than basically run it with either:clojure -X:command
or
clojure -M:command
or
clojure -T:command
If
command
clashed withneil
's own commands, I would put a message like:conflicts with neil command and your deps.edn command, defaulting to running neil's command, if you want to run deps's command explicitly call:
neil clojure command
So for example, one could do:
deps.edn
And now from command line:
$ neil run
- runs clojure -M:run$ neil run-x
- runs clojure -X:run-x$ neil build uber
- runs clojure -T:build uber$ neil test
- runs clojure -M:testWhen it is ambiguous what the run-as should be, such as here:
I think neil could prompt:
Or if the alias contains a
:neil/run-as
than that is used instead.Maybe we can also have a neil command to set the
:neil/run-as
or after it prompts the first time we can have it set it automatically for future invocation.This would basically allow any alias to become a
neil
command.Alternative
Alternatively, we can put this behavior behind a command, so maybe:
neil run alias
It would behave the same, but you'd have to do:
$ neil run run
- runs clojure -M:run$ neil run run-x
- runs clojure -X:run-x$ neil run build uber
- runs clojure -T:build uber$ neil run test
- runs clojure -M:testAnd maybe in this case we could also have an explicit
run-as
command:$ neil run-as main run
- runs clojure -M:run$ neil run-as exec run-x
- runs clojure -X:run-x$ neil run-as tool build uber
- runs clojure -T:build uber$ neil run-as main test
- runs clojure -M:testBeta Was this translation helpful? Give feedback.
All reactions