Parse and convert flags.