File tree Expand file tree Collapse file tree 7 files changed +49
-3
lines changed
Expand file tree Collapse file tree 7 files changed +49
-3
lines changed Original file line number Diff line number Diff line change @@ -25,6 +25,7 @@ target("templates_test")
2525| name | introduce | demo | other |
2626| --- | --- | --- | --- |
2727| [ templates] ( https://github.com/mcpplibs/templates ) | A template of modern C++ ` modules ` libraries | [ templates_test] ( tests/t/templates ) | |
28+ | [ cmdline] ( https://github.com/mcpplibs/cmdline ) | A simple command-line parsing library/framework for modern C++ | [ cmdline_test] ( tests/c/cmdline ) | |
2829| [ llmapi] ( https://github.com/mcpplibs/llmapi ) | Modern C++ LLM API client with openai-compatible support | [ llmapi_test] ( tests/l/llmapi ) | |
2930
3031## Other
Original file line number Diff line number Diff line change 1+ package (" cmdline" )
2+
3+ set_homepage (" https://github.com/mcpplibs/cmdline" )
4+ set_description (" A simple command-line parsing library/framework for modern C++" )
5+ set_license (" Apache-2.0" )
6+
7+ add_urls (
8+ " https://github.com/mcpplibs/cmdline/archive/refs/tags/$(version).tar.gz" ,
9+ " https://github.com/mcpplibs/cmdline.git"
10+ )
11+
12+ on_install (function (package )
13+ import (" package.tools.xmake" ).install (package )
14+ end )
Original file line number Diff line number Diff line change 1+ // more-details: https://github.com/mcpplibs/cmdline
2+ import std;
3+ import mcpplibs.cmdline;
4+
5+ using namespace mcpplibs ;
6+
7+ int main (int argc, char * argv[]) {
8+ auto app = cmdline::App (" myapp" )
9+ .version (" 1.0.0" )
10+ .description (" A demo CLI" )
11+ .arg (" input" ).required ().help (" Input file" )
12+ .option (" verbose" ).short_name (' v' ).help (" Verbose output" )
13+ .option (" config" ).short_name (' c' ).takes_value ().value_name (" FILE" ).help (" Config file" )
14+ .action ([](const cmdline::ParsedArgs& p) {
15+ if (p.is_flag_set (" verbose" )) std::println (" Verbose on" );
16+ if (auto c = p.value (" config" )) std::println (" Config: {}" , *c);
17+ std::println (" Input: {}" , p.positional (0 ));
18+ });
19+
20+ return app.run (argc, argv);
21+ }
Original file line number Diff line number Diff line change 1+ add_repositories (" mcpplibs-index https://github.com/mcpplibs/mcpplibs-index.git" )
2+
3+ add_requires (" cmdline" , {system = false })
4+
5+ target (" cmdline_test" )
6+ set_kind (" binary" )
7+ set_languages (" c++23" )
8+ add_files (" main.cpp" )
9+ add_packages (" cmdline" )
10+ set_policy (" build.c++.modules" , true )
Original file line number Diff line number Diff line change 1- add_repositories (" mcpplibs-index git@ github.com: mcpplibs/mcpplibs-index.git" )
1+ add_repositories (" mcpplibs-index https:// github.com/ mcpplibs/mcpplibs-index.git" )
22
33add_requires (" llmapi 0.0.1" , {configs = { capi = true }})
44
Original file line number Diff line number Diff line change 1- add_repositories (" mcpplibs-index git@ github.com: mcpplibs/mcpplibs-index.git" )
1+ add_repositories (" mcpplibs-index https:// github.com/ mcpplibs/mcpplibs-index.git" )
22
33add_requires (" llmapi 0.0.2" )
44
Original file line number Diff line number Diff line change 1- add_repositories (" mcpplibs-index git@ github.com: mcpplibs/mcpplibs-index.git" )
1+ add_repositories (" mcpplibs-index https:// github.com/ mcpplibs/mcpplibs-index.git" )
22
33add_requires (" templates 0.0.1" )
44-- add_requires("mcpplibs-index::templates 0.0.1") -- TODO: impl prefix support in xmake
You can’t perform that action at this time.
0 commit comments