Finishes CLI main function