Parse command line flags and subcommands