CLI option to run arbitrary command #10021
Unanswered
kanashimia
asked this question in
Ideas
Replies: 1 comment
-
This was discussed a little in the initial PR that lead to #8521 #5603 (comment) and I believe elsewhere but I can't find the link. I'm very skeptical that we need this feature. Helix is meant to be run interactively so we try to keep the argument parsing and behavior very simple. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
#8521 added +N number handling to helix, but in vim +N actually executes command N.
Helix already handles :N so it would be possible to generalise the behaviour.
Possible flag names are:
--cmd
-C
-x
-e
--run
--exec
Possible description:
This flag will be useful for scripting. Another one could be added later to source commands from
There are two ways it could work:
Exiting immediately using these two approaches:
hx --cmd quit
hx --cmd ':quit<ret>'
It is also possible to keep + for the first approach and and add --cmd for the second one.
I tried to implement the second approach like this:
That code is in
Application::new
just afterlet app =
, but it seems to break on:quit<ret>
I believe it requires view or something to be already created, couldn't figure out how to do that without adding a new event type, as that seemed too complicated for no reason, so for now will just keep this issue here.
I also didn't find an API to implement the first approach.
Beta Was this translation helpful? Give feedback.
All reactions