summaryrefslogtreecommitdiff
path: root/src/cli/cmd.h
blob: 8b1a1b38fd780118a01695678c19001b7865e1ba (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
/*
 * 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.
 */

#ifndef CLI_cmd_h__
#define CLI_cmd_h__

/* Command definitions */
typedef struct {
	const char *name;
	int (*fn)(int argc, char **argv);
	const char *desc;
} cli_cmd_spec;

/* Options that are common to all commands (eg --help, --git-dir) */
extern const cli_opt_spec cli_common_opts[];

/* All the commands supported by the CLI */
extern const cli_cmd_spec cli_cmds[];

/* Find a command by name */
extern const cli_cmd_spec *cli_cmd_spec_byname(const char *name);

/* Commands */
extern int cmd_cat_file(int argc, char **argv);
extern int cmd_clone(int argc, char **argv);
extern int cmd_hash_object(int argc, char **argv);
extern int cmd_help(int argc, char **argv);

#endif /* CLI_cmd_h__ */