Code Monkey home page Code Monkey logo

dimcli's People

Contributors

gknowles avatar qix- avatar ziemien avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

dimcli's Issues

what compilers are supported?

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;
                         ^~~

Dimcli build failed with Visual Studio 2019 due to warning C5055

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

Match unambiguous abbreviated long options

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

Add callbacks

There could be callback events for parsing, validation, help generation, etc

Tuple arguments

Allow tuple<> arguments that would match contiguous values. For example tuple<int,int> could match "-t 1 2"

Response files

Expand the command line by replacing "@" arguments with the contents of

Allow multiple or composable parsers for a single option

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.

Crash when using natural order for subcommand options

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

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.