summaryrefslogtreecommitdiff
path: root/src/cli/cmd.c
blob: 2a7e71cdbcba8cf54aea88911ac6c5c32b3bcb85 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
/*
 * 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.
 */

#include "cli.h"
#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;
}