Oh! Another getting-old one that must be mentioned, The Irresponsible Captain Tylor (tv series). Space opera, comedy, SFW as far as I remember.
Directionless man signs up for the military, this that and the other lead to him being in command of a ship, war and adventures in space ensue. Idiot or genius? Still wondering.