FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
git2cpp/src/main.cpp at main · QuantStack/git2cpp · GitHub
QuantStack
git2cpp
Repository navigation
Code
Issues
6
(6)
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
git2cpp
/
src
/
main.cpp
Copy path
More file actions
More file actions
Latest commit
History
History
History
100 lines (91 loc) · 3.24 KB
Breadcrumbs
git2cpp
/
src
/
main.cpp
Copy path
File metadata and controls
100 lines (91 loc) · 3.24 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
#
include
<
cmath
>
#
include
<
iostream
>
#
include
<
CLI/CLI.hpp
>
#
include
<
git2.h
>
//
For version number only
#
include
"
subcommand/add_subcommand.hpp
"
#
include
"
subcommand/branch_subcommand.hpp
"
#
include
"
subcommand/checkout_subcommand.hpp
"
#
include
"
subcommand/clone_subcommand.hpp
"
#
include
"
subcommand/commit_subcommand.hpp
"
#
include
"
subcommand/config_subcommand.hpp
"
#
include
"
subcommand/diff_subcommand.hpp
"
#
include
"
subcommand/fetch_subcommand.hpp
"
#
include
"
subcommand/init_subcommand.hpp
"
#
include
"
subcommand/log_subcommand.hpp
"
#
include
"
subcommand/merge_subcommand.hpp
"
#
include
"
subcommand/mv_subcommand.hpp
"
#
include
"
subcommand/push_subcommand.hpp
"
#
include
"
subcommand/rebase_subcommand.hpp
"
#
include
"
subcommand/remote_subcommand.hpp
"
#
include
"
subcommand/reset_subcommand.hpp
"
#
include
"
subcommand/revlist_subcommand.hpp
"
#
include
"
subcommand/revparse_subcommand.hpp
"
#
include
"
subcommand/rm_subcommand.hpp
"
#
include
"
subcommand/showref_subcommand.hpp
"
#
include
"
subcommand/stash_subcommand.hpp
"
#
include
"
subcommand/status_subcommand.hpp
"
#
include
"
subcommand/tag_subcommand.hpp
"
#
include
"
utils/git_exception.hpp
"
#
include
"
version.hpp
"
int
main
(
int
argc,
char
** argv)
{
int
exit_code =
0
;
try
{
const
libgit2_object lg2_obj;
CLI
::App app{
"
Git using C++ wrapper of libgit2
"
};
//
Top-level command options.
auto
version = app.
add_flag
(
"
-v,--version
"
,
"
Show version
"
);
//
Sub commands
init_subcommand
init
(lg2_obj, app);
status_subcommand
status
(lg2_obj, app);
add_subcommand
add
(lg2_obj, app);
branch_subcommand
branch
(lg2_obj, app);
checkout_subcommand
checkout
(lg2_obj, app);
clone_subcommand
clone
(lg2_obj, app);
commit_subcommand
commit
(lg2_obj, app);
config_subcommand
config
(lg2_obj, app);
diff_subcommand
diff
(lg2_obj, app);
fetch_subcommand
fetch
(lg2_obj, app);
reset_subcommand
reset
(lg2_obj, app);
log_subcommand
log
(lg2_obj, app);
merge_subcommand
merge
(lg2_obj, app);
mv_subcommand
mv
(lg2_obj, app);
push_subcommand
push
(lg2_obj, app);
rebase_subcommand
rebase
(lg2_obj, app);
remote_subcommand
remote
(lg2_obj, app);
revlist_subcommand
revlist
(lg2_obj, app);
revparse_subcommand
revparse
(lg2_obj, app);
rm_subcommand
rm
(lg2_obj, app);
stash_subcommand
stash
(lg2_obj, app);
tag_subcommand
tag
(lg2_obj, app);
showref_subcommand
showref
(lg2_obj, app);
app.
require_subcommand
(
/*
min
*/
0
,
/*
max
*/
1
);
CLI11_PARSE
(app, argc, argv);
if
(version->
count
())
{
std::cout <<
"
git2cpp version
"
<<
GIT2CPP_VERSION_STRING
<<
"
(libgit2
"
<<
LIBGIT2_VERSION
<<
"
)
"
<< std::endl;
}
else
if
(app.
get_subcommands
().
size
() ==
0
)
{
std::cout << app.
help
() << std::endl;
}
}
catch
(
const
CLI
::Error& e)
{
std::cerr << e.
what
() << std::endl;
exit_code =
1
;
}
catch
(
const
git_exception& e)
{
std::cerr << e.
what
() << std::endl;
exit_code = e.
error_code
();
}
catch
(std::exception& e)
{
std::cerr << e.
what
() << std::endl;
exit_code =
1
;
}
return
exit_code;
}
Back
|
FazBrowse Home
|
New Git URL