change cmdargs to optparse-applicative.