Raw
1 #include "test-tool.h"
2 #include "git-compat-util.h"
3 #include "parse-options.h"
4
5 static const char *const getcwd_usage[] = {
6 "test-tool getcwd",
7 NULL
8 };
9
10 int cmd__getcwd(int argc, const char **argv)
11 {
12 struct option options[] = {
13 OPT_END()
14 };
15 char *cwd;
16
17 argc = parse_options(argc, argv, "test-tools", options, getcwd_usage, 0);
18 if (argc > 0)
19 usage_with_options(getcwd_usage, options);
20
21 cwd = xgetcwd();
22 puts(cwd);
23 free(cwd);
24
25 return 0;
26 }