Sorry for the bad title but i had no idea how to describe it.
I am building a console app. The general idea is that it runs permanently (and does some background stuff) when entering such a command:
App.exe run
I then would like to terminate the app when entering
App.exe exit
How would you do this? Is there something i need to keep in mind when i want such an behaviour? Or is there a better way?
I know that args[] has all the parameters stored but how would you "find" the other running process and terminate it? As i understand it, when doing run and then exit, i just open the programm two times. So exit needs to close the running process and itself.