On Fri, 1 Jul 2016 13:22:09 -0700 (PDT) ethanlewis...@gmail.com wrote: [...] > I have multiple applications that have a lot of command line flags and > didn't want to have to worry about executing them threw os.exec.
But this is super-simple to have in fact. In the simplest case just stick os.Args of your Go program into the command line you're building with os/exec.Cmd() and then all the command-line arguments you pass to your Go wrapper will be passed to the program it will call. If you want it to be more fancy and have your Go program understand its own command-line arguments, then first scan os.Args for a special argument "--", and then use whatever precedes it as a set of command-line arguments for your Go program through flag.NewFlagSet() and the FlagSet's Parse() method, which accepts a slice of strings to parse, and use what follows that special argument "--" as the command-line arguments for the program to call. That's a pretty standard practice to handle such cases. To reiterate, I think you're trying to approach your problem from the wrong end. Messing with ptrace()-ing a running program is kewl, but real-world programming is not really about kewl solutions but rather simple and robust ones (and that which could be understood by reading the code after six months). [...] -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.