cmd.c 450 Bytes
Newer Older
1 2 3 4 5 6 7
/*
 * Copyright (C) the libgit2 contributors. All rights reserved.
 *
 * This file is part of libgit2, distributed under the GNU GPL v2 with
 * a Linking Exception. For full terms see the included COPYING file.
 */

8
#include "common.h"
9 10 11 12 13 14 15 16 17 18 19 20 21
#include "cmd.h"

const cli_cmd_spec *cli_cmd_spec_byname(const char *name)
{
	const cli_cmd_spec *cmd;

	for (cmd = cli_cmds; cmd->name; cmd++) {
		if (!strcmp(cmd->name, name))
			return cmd;
	}

	return NULL;
}