[prev in list] [next in list] [prev in thread] [next in thread] 

List:       busybox
Subject:    Anyone working on implementing ':r! cmd' for the vi applet?
From:       "Jason Pena" <jasonpena () awkless ! com>
Date:       2024-02-12 18:34:17
Message-ID: CZ3BEQ56YGHM.38O2MBLADT0V4 () awkless ! com
[Download RAW message or body]

Hello, is anyone currently working on implementing ':r! cmd' for the vi applet?
If not, then I have a simple plan to implement ':r! cmd' with some basic
work-in-progress code.

In general, by altering "read" in colon() to use popen() to open a pipe to
process the shell command. Then use fgets() to get the output of the shell
command to a buffer that can then be inserted into the current edit buffer using
string_insert().

I think the only real issue is deciding whether or not to use a new flag to
determine when the user chooses to use ':r file' instead of ':r! cmd'. The
"useforce" flag would not make a lot of semantic sense. Hence, why the test code
I have uses a new variable called "variant" to distinguish between ':r file' and
':r! cmd'.

All in all, let me know if anyone is already doing this, or to convert my
work-in-progress code into a full feature patch submission.
_______________________________________________
busybox mailing list
busybox@busybox.net
http://lists.busybox.net/mailman/listinfo/busybox
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic