gknowles / dimcli Goto Github PK
View Code? Open in Web Editor NEWC++ Command Line Parser Toolkit
Home Page: https://gknowles.github.io/dimcli
License: Boost Software License 1.0
C++ Command Line Parser Toolkit
Home Page: https://gknowles.github.io/dimcli
License: Boost Software License 1.0
Hello,
it's not clear from the project description what compilers are supported or which C++ standard it conforms to. I mean compilers other than VS 2015.
I just tried GCC 6 and it shows a long list of errors, the first one being:
cli.cpp:57:11: error: underlying type mismatch in enum ‘enum Dim::Cli::NameListType’
enum Cli::NameListType {
^~~~~~~~~~~~
In file included from cli.cpp:7:0:
../include/dimcli/cli.h:155:25: error: previous definition here
enum NameListType : int;
^~~
Git style subcommands and distributed argument declaration
Speaking as a mainly Windows programmer I don't really care very much, but yeah...
When someone passes in a random switch there should be a way to see it, instead of always being an error (or ignored).
My first ever use of it (it is rather painful) and the committee deprecated it a few months later.
Description:
Dimcli 5.0.0 build failed with Visual Studio 2019 due to warning C5055.
Failures:
5>F:\0814\vcpkg\buildtrees\dimcli\src\v5.0.0-89211a3afb\libs\dimcli\cli.h(1501,15): error C2220: warning treated as error - no 'object' file generated [F:\0814\vcpkg\buildtrees\dimcli\x64-windows-dbg\cli.vcxproj]
5>F:\0814\vcpkg\buildtrees\dimcli\src\v5.0.0-89211a3afb\libs\dimcli\cli.h(1501,15): warning C5055: operator '>=': deprecated between enumerations and floating-point types
Attach my build log:
install-x64-windows-dbg-out.log
hello,
the vcpkg package is still for version 5.0.2 and is not updated to the latest version
For example, "help" could be matched by --hel, --he, and --h, as well as --help
Ambiguous matches would fail with something like:
Ambiguous option "--h", possibilities: --help, --http
More control over how help is formatted, both overall styles and substituting variable and value names
There could be callback events for parsing, validation, help generation, etc
Allow tuple<> arguments that would match contiguous values. For example tuple<int,int> could match "-t 1 2"
Expand the command line by replacing "@" arguments with the contents of
Moving the file to the binary dir helps.
For example integer could accept locale, scientific, engineering (K, Ki, M, Mi, etc), formats. That way any of the following could be used to give you "10,000":
10000
10,000
1e+4
10k
This could apply to anything that has multiple representations, such as timepoints, durations, host names, etc.
Could you please point out what this library offers or how it varies from CLI11 ? https://github.com/CLIUtils/CLI11
The docs say:
Git style subcommands are created by either cli.command("cmd"), which changes the cli objects context to the command, or with opt.command("cmd"), which changes the command that option is for.
However when I try that:
static auto & command = Dim::Cli().command("apple").desc("Change color of the apple.");
static auto & color = command.opt<string>("color", "red");
I get a segfault:
#0 0x00007f2e553ac193 in std::__detail::_List_node_base::_M_hook(std::__detail::_List_node_base*) () from /lib/x86_64-linux-gnu/libstdc++.so.6
#1 0x000055799bf8087d in std::__cxx11::list<std::unique_ptr<Dim::Cli::OptBase, std::default_delete<Dim::Cli::OptBase> >, std::allocator<std::unique_ptr<Dim::Cli::OptBase, std::default_delete<Dim::Cli::OptBase> > > >::_M_insert<std::unique_ptr<Dim::Cli::OptBase, std::default_delete<Dim::Cli::OptBase> > > (this=0x7ffcab754a50, __position=...) at /usr/include/c++/10/bits/stl_list.h:1912
#2 0x000055799bf7dcff in std::__cxx11::list<std::unique_ptr<Dim::Cli::OptBase, std::default_delete<Dim::Cli::OptBase> >, std::allocator<std::unique_ptr<Dim::Cli::OptBase, std::default_delete<Dim::Cli::OptBase> > > >::push_back (this=0x7ffcab754a50, __x=...) at /usr/include/c++/10/bits/stl_list.h:1217
#3 0x000055799bf562cf in Dim::Cli::addOpt (this=0x7ffcab754990, src=...) at _deps/dimcli-src/libs/dimcli/cli.cpp:1273
#4 0x000055799bf48caa in Dim::Cli::addOpt<Dim::Cli::Opt<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > > (this=0x7ffcab754990, ptr=...)
at _deps/dimcli-src/libs/dimcli/cli.h:885
#5 0x000055799bf47df3 in Dim::Cli::opt<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, void, void> (this=0x7ffcab754990, value=0x0, names=..., def=...) at _deps/dimcli-src/libs/dimcli/cli.h:811
#6 0x000055799bf47747 in Dim::Cli::opt<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > (this=0x7ffcab754990, names=..., def=...) at _deps/dimcli-src/libs/dimcli/cli.h:856
#7 0x000055799bf46b69 in __static_initialization_and_destruction_0 (__initialize_p=1, __priority=65535) at ../main.cpp:9
#8 0x000055799bf46d0e in _GLOBAL__sub_I__Z5appleRN3Dim3CliE () at ../main.cpp:26
#9 0x000055799bf8e45d in __libc_csu_init ()
#10 0x00007f2e54fc04f1 in __libc_start_main () from /lib/x86_64-linux-gnu/libc.so.6
#11 0x000055799bf462ee in _start ()
Reproducible example: https://github.com/jtojnar/repro/tree/f742c8ef00ae5f9677a65ebce29201cfa52918c7/dimcli-natural-static
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.