private static CowFace getCowFaceByMode ( final CommandLine commandLine ) { CowFace cowFace = null ; Set < String > modes = CowFace . COW_MODES . keySet ( ) ; for ( String mode : modes ) { if ( commandLine . hasOption ( mode ) ) { cowFace = CowFace . getByMode ( mode ) ; break ; } } return cowFace ; }
If a pre - defined cow mode has been set on the command line then use that face .