Implement the merge subcommand