Skip to content

Added option "--exec CMD"#158

Open
michael105 wants to merge 5 commits into
jhawthorn:masterfrom
michael105:master
Open

Added option "--exec CMD"#158
michael105 wants to merge 5 commits into
jhawthorn:masterfrom
michael105:master

Conversation

@michael105

Copy link
Copy Markdown

For a documentation browser (https://github.com/michael105/libc-manpages)
I added the option to execute commands from within fzy.
imho, would be great to include that mainline.
best wishes,Michael

Comment thread src/options.c Outdated
" -0, --read-null Read input delimited by ASCII NUL characters\n"
" -j, --workers NUM Use NUM workers for searching. (default is # of CPUs)\n"
" -i, --show-info Show selection info line\n"
" -x, --exec=PROG Execute prog on selection. Don't exit.\n"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The indentation is different here, than in the surrounding lines

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, ;) I literally didn't see it. Fixed it, and trying to push it again.

@neuschaefer

Copy link
Copy Markdown
Contributor

Hi, thanks for your PR.

This feature seems relatively unnecessary to me, since I think it could easily be implemented in a wrapper script.

@michael105

Copy link
Copy Markdown
Author

Hi, thanks for your PR.

This feature seems relatively unnecessary to me, since I think it could easily be implemented in a wrapper script.

That would do something different; what I added doesn't exit fzy, instead it spawns the command, waits for the program to exit and returns to exactly the same state before launching the external tool.
It's quite handy for e.g. the manual browser I did put online.
Look for a manpage, launch man, go back and compare e.g. the posix manual page with the freebsd's one.
There might be other usecases, like a directory browser, andsoon..
Thanks for this wonderful tool btw.
Best wishes, Michael

@neuschaefer

Copy link
Copy Markdown
Contributor

Ah thanks, I understand now

@michael105

Copy link
Copy Markdown
Author

:-? just for the record, the 'acceptance check' has necessarily to fail,
since the output of the help screen is compared between old and patched version.
There I added the explanation of the option --exec, so, this cannot work out..

@rsmirnov90

Copy link
Copy Markdown

just came across this and was curious would be needed to merge this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants