uchess icon indicating copy to clipboard operation
uchess copied to clipboard

fix: implement quit command fixes #9

Open jfkw opened this issue 2 years ago • 0 comments

The quit command is not implemented although it is documented. cmd/uchess does handle Ctrl-C to exit currently.

Add a pkg/cmd ProcessCmd() case handler for the command "quit". Add a private function pkg/cmd quit() where additional game state shutdown housekeeping could be processed, e.g. autosave on quit if desired. Currenly the function only returns the msg "quit", mirroring the hint command.

Add a cmd/uchess Interact() handler for the msg "quit". On quit, ask for confirmation with Y or y. Exit process on confirm, without saving as is currently documented. Move the internal function Interact().quit() to a public function cmd/uchess Quit() where additional process shutdown housekeeping could be implemented. Currently the function only calls gamestate S.Fini() and os.Exit(0) the process with return code.

jfkw avatar Mar 30 '23 05:03 jfkw