def _cmdline(argv=None):
    """ Parse command line arguments.

    By default, sys.argv is parsed.

    """
    parser = ArgumentParser()
    parser.add_argument("--checkout", default="HEAD",
                        help="branch, tag, or commit to use [HEAD]")
    parser.add_argument("--name", default=_NAME,
                        help="application name [{:s}]".format(_NAME))
    parser.add_argument("--repo", default=_REPO,
                        help="source repo [{:s}]".format(_REPO))
    parser.add_argument("--test", action="store_true",
                        help="run test suite after installation")
    parser.add_argument("root", help="installation root")
    return parser.parse_args(argv)