kirk-patton / cobra-fork

Fork/Detach a Cobra subcommand

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

cobra-fork

Fork/Detach a Cobra subcommand

An example of how to detach a process, defined as a cobra command, and keep it running separate from the parent process.

  • create a child process
  • record its process id
  • exit the parent
  • kill the child process using its recorded pid

About

Fork/Detach a Cobra subcommand

License:GNU General Public License v3.0


Languages

Language:Go 100.0%