GithubHelp home page GithubHelp logo

gerhobbelt / clippson Goto Github PK

View Code? Open in Web Editor NEW

This project forked from heavywatal/clippson

0.0 0.0 0.0 63 KB

๐Ÿ“Ž Helper library of clipp, C++ command-line parser

License: MIT License

CMake 9.16% C++ 90.84%

clippson's Introduction

clippson

Build status

This is a helper library of muellan/clipp, the awesome C++ command-line parser.

  • Support using nlohmann/json as a boost::program_options::variables_map-like object, which makes it possible to print all the variables at once to console/files in a computer-readable format.
  • Create a pair of clipp::option and clipp::value (as a clipp::group) with a doc string including its default value.
  • Use std::sto***() to validate arguments and convert strings. A proper function is chosen for each clipp::value based on the type of its target variable.
  • Support comma separated values for vector targets, e.g., -v 1,2,3.
  • Support limiting choices of values.
  • Accept = as an optional separator of a flag and its value, e.g., --longopt=value is treated almost equally as --longopt value.
  • Support CMake building system.

Installation

The easiest way is to use Homebrew. The following command installs tumopp and all the dependencies:

brew install heavywatal/tap/clippson

Alternatively, you can get the source code from GitHub manually:

git clone https://github.com/heavywatal/clippson.git
cd clippson/
git submodule update --init --recursive
mkdir build
cd build/
DESTINATION=${HOME}/local
cmake -DCMAKE_INSTALL_PREFIX=$DESTINATION ..
make -j2 install

clippson.hpp and the required headers, clipp.h and json.hpp, are installed to ${CMAKE_INSTALL_PREFIX}/include/clippson/.

Usage

Add #include <clippson/clippson.hpp> to your source code. Functions are defined in the namespace wtl. The required headers clipp.h and json.hpp are included therein, hence their functions are available in the original namespaces.

See test/example.cpp for more details.

This library can be imported as a CMake package:

find_package(clippson REQUIRED)
target_link_libraries(your_project PRIVATE clippson::clippson)

clippson's People

Contributors

gerhobbelt avatar heavywatal avatar

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.