-
Notifications
You must be signed in to change notification settings - Fork 35
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[Q] How to pass the arguments? #66
Comments
There's no way to do that currently - That said I would love to hear some ideas on how to better implement forwarding arguments to scripts as I def think it would make sense to support it 😊 |
Hi, |
I gave it some thought and I think a very good UX for this would be something like:
and then allowing users to enter an
Then once they hit ENTER we run this modified script instead, we could even go a step further and save it to the history of commands so that if when you run
I realize this might be a bit too much and even require some playing with Inquirer.js internals but I just wanted to lay out the ideas I've had 😊 I'm still open to suggestions, feedback and will consider any contribution you want to submit 😄 |
I need this functionality too. Normal mode:
With arguments mode:
I think the idea is clear. p. s.: Sorry for my english |
thank you so much @sergeyblohin! YES, your idea is clear and I think it's even better than what I previously proposed! Having a second prompt is not only much easier to implement but also probably more intuitive for the majority of users 😊 I also think having an argument (such as I already have a local branch started and will probably have some time to wrap up work on it soon 😄 |
i thought it would be cool to add the required params next to the ntl.descriptions in the project.json, so ntl could ask ( pompt for each one like @sergeyblohin mentioned) for the param by showing its name:
|
@BananaAcid that looks a little bit more evolved than what I'm planning to land at first but I can see the value and maybe we can follow up with something similar to that in the future. It's been hard to find the time to wrap this up but I would like to provide some updates to anyone still keeping an eye on this, I have a working version of the second prompt as proposed by @sergeyblohin which for now only allows editing the arguments when pressing e (I personally find this more useful since I often only remember I wanted to edit an arg once I see the interface). To give it a try now, install from the development branch:
It would be awesome to gather some feedback on it before shipping 😊 |
Any updates on this? |
for now I'd appreciate any feedback from folks with different environments, you can give it a quick try using npx:
but ideally before shipping I'd also like to add support to cli arguments as @sergeyblohin suggested previously |
I am not sure, what feature is new and how to test it - could you give an example? |
For now the main thing there is an "Edit script" interface that aims to solve the problem stated at the origin of this thread (being able to pass arguments to scripts), to use it you simply hit (e) when the selector is over the item you desired to pass arguments to in the list. |
How to pass arguments for the scripts. For example,
How do I do this when executing a script through ntl?
The text was updated successfully, but these errors were encountered: