kareman / SwiftShell

A Swift framework for shell scripting.
https://kareman.github.io/SwiftShell
MIT License
1.03k stars 87 forks source link

Is there a way to interrupt a shell cmd? #33

Closed kdawgwilk closed 7 years ago

kdawgwilk commented 7 years ago

I am creating a CLI tool and need to call out to various shell commands but still want to give the user the ability to interrupt the external cmd that is running to quit the currently running script

kareman commented 7 years ago

Yes you can call the stop method:

let asynctask = runAsync("cmd", "arg1", "arg2" )
asynctask.stop()
kdawgwilk commented 7 years ago

Thanks! Was searching through docs but didn't see it right away