How can I add a --file (run multiple commands in a file) option to GoLang Cobra app

222 views Asked by At

One of the more popular Linux command line tools (sed) has this option:

 -f command_file
             Append the editing commands found in the file command_file to the list of commands.  The editing
             commands should each be listed on a separate line.  The commands are read from the standard input if
             command_file is “-”.

I want to add this same capability to my Cobra-based GoLang command line tool.

I've explored a lot of different possibilities, but none seem satisfactory. Any suggestions?

0

There are 0 answers