Wire up commandline for diagrams. Refactor on how flags are handled