add exit function
Merge branch 'cli'