FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
git2cpp/src/main.cpp at 0.0.3 · 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
66 lines (58 loc) · 1.9 KB
Breadcrumbs
git2cpp
/
src
/
main.cpp
Copy path
File metadata and controls
66 lines (58 loc) · 1.9 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
#
include
<
CLI/CLI.hpp
>
#
include
<
git2.h
>
//
For version number only
#
include
<
iostream
>
#
include
"
utils/git_exception.hpp
"
#
include
"
version.hpp
"
#
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/init_subcommand.hpp
"
#
include
"
subcommand/reset_subcommand.hpp
"
#
include
"
subcommand/status_subcommand.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);
reset_subcommand
reset
(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