1
0
mirror of https://github.com/CLIUtils/CLI11.git synced 2025-04-29 12:13:52 +00:00

BSD licence, preparing for 1.0 release

This commit is contained in:
Henry Fredrick Schreiner 2017-06-01 09:21:09 -04:00
parent eedb6771be
commit 916cde58cf
14 changed files with 32 additions and 35 deletions

View File

@ -1,6 +1,7 @@
## Version 1.0 (in progress)
## Version 1.0
* Cleanup using `clang-tidy` and `clang-format`
* Small improvements to Timers, easier to subclass Error
* Move to 3-Clause BSD license
## Version 0.9

21
LICENSE
View File

@ -1,16 +1,11 @@
CLI11: A command line parser for C++11
Copyright (C) 2017 Henry Schreiner
CLI11 1.0 Copyright (c) 2017 University of Cincinnati, developed by Henry Schreiner under NSF AWARD 1414736.
All rights reserved.
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version.
Redistribution and use in source and binary forms of CLI11, with or without modification, are permitted provided that the following conditions are met:
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details.
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA

View File

@ -2,19 +2,20 @@
[![Build Status Windows][appveyor-badge]][AppVeyor]
[![Code Coverage][codecov-badge]][CodeCov]
[![Join the chat at https://gitter.im/CLI11gitter/Lobby][gitter-badge]][gitter]
[![License: LGPL v2.1][license-badge]](./LICENSE)
[![License: BSD][license-badge]](./LICENSE)
# CLI11: Command line parser for C++11
CLI11 provides all the features you expect in a powerful command line parser, with a beautiful, minimal syntax and no dependencies beyond C++11. It is header only, and comes in a single file form for easy inclusion in projects. It is easy to use for small projects, but powerful enough for complex command line projects, and can be customized for frameworks.
It is tested on [Travis] and [AppVeyor], and is being included in the [GooFit GPU fitting framework][GooFit]. It was inspired by [`plumbum.cli`][Plumbum] for Python. CLI11 has both a user friendly introduction here, as well as [API documentation][api-docs] generated by Travis.
See the [changelog](./CHANGELOG.md) or [GitHub Releases] for details for current and past releases.
### Why write another CLI parser?
An acceptable CLI parser library should be all of the following:
* Easy to include (i.e., header only, one file if possible, no external requirements): While many programs depend on Boost, that should not be a requirement if all you want is CLI parsing.
* Easy to include (i.e., header only, one file if possible, **no external requirements**): While many programs depend on Boost, that should not be a requirement if all you want is CLI parsing.
* Short Syntax: This is one of the main points of a CLI parser, it should make variables from the command line nearly as easy to define as any other variables. If most of your program is hidden in CLI parsing, this is a problem for readability.
* C++11 or better: Should work with GCC 4.7+ (such as GCC 4.8 on CentOS 7) or above, or Clang 3.5+, or MSVC 2015+. (Note: for CLI11, Clang 3.4 only fails because of tests, GoogleMock does not support it.)
* Work on Linux, macOS, and Windows.
@ -26,7 +27,8 @@ An acceptable CLI parser library should be all of the following:
* Usable subcommand syntax, with support for multiple subcommands, nested subcommands, and optional fallthrough (explained later).
* Ability to add a configuration file (`ini` format).
* Produce real values that can be used directly in code, not something you have pay compute time to look up, for HPC applications.
* Work with standard types, simple custom types, and extendable to exotic types.
* Work with standard types, simple custom types, and extendible to exotic types.
* Permissively licenced.
The major CLI parsers for C++ include:
@ -38,12 +40,9 @@ The major CLI parsers for C++ include:
* [GFlags]: The Google Commandline Flags library. Uses macros heavily, and is limited in scope, missing things like subcommands. It provides a simple syntax and supports config files/env vars.
* [GetOpt]: Very limited C solution with long, convoluted syntax. Does not support much of anything, like help generation. Always available on UNIX, though (but in different flavors).
None of these libraries fulfill all the above requirements. As you probably have already guessed, CLI11 does.
So, this library was designed to provide a great syntax, good compiler compatibility, and minimal installation fuss.
## Changelog
See the [changelog](./CHANGELOG.md) or [GitHub Releases] for details.
## Features not supported by this library
As you probably have guessed, the list of features above are all covered by this library. There are some other features that are intentionally not supported by this library:
@ -241,6 +240,8 @@ app.add_option("--fancy-count", [](std::vector<std::string> val){
To contribute, open an [issue][Github Issues] or [pull request][Github Pull Requests] on GitHub, or ask a question on [gitter].
As of version 1.0, this library is available under a 3-Clause BSD license. See the [LICENSE](./LICENSE) file for details.
## Utilities
There are a few other utilities that are often useful in CLI programming. These are in separate headers, and do not appear in `CLI11.hpp`, but are completely independent and can be used as needed. The `Timer`/`AutoTimer` class allows you to easily time a block of code, with custom print output.
@ -257,7 +258,7 @@ string for printing.
## Other libraries
If you use the [Rang] library to add color to your terminal in a safe, multi-platform way, you can combine it with CLI11 nicely:
If you use the excellent [Rang] library to add color to your terminal in a safe, multi-platform way, you can combine it with CLI11 nicely:
```cpp
std::atexit([](){std::cout << rang::style::reset;});
@ -280,7 +281,7 @@ This will print help in blue, errors in red, and will reset before returning the
[CodeCov]: https://codecov.io/gh/CLIUtils/CLI11
[gitter-badge]: https://badges.gitter.im/CLI11gitter/Lobby.svg
[gitter]: https://gitter.im/CLI11gitter/Lobby
[license-badge]: https://img.shields.io/badge/License-LGPL%20v2.1-blue.svg
[license-badge]: https://img.shields.io/badge/License-BSD-blue.svg
[Github Releases]: https://github.com/CLIUtils/CLI11/releases
[Github Issues]: https://github.com/CLIUtils/CLI11/issues
[Github Pull Requests]: https://github.com/CLIUtils/CLI11/pulls

View File

@ -1,6 +1,6 @@
#pragma once
// Distributed under the LGPL v2.1 license. See accompanying
// Distributed under the 3-Clause BSD License. See accompanying
// file LICENSE or https://github.com/CLIUtils/CLI11 for details.
#include <algorithm>

View File

@ -1,6 +1,6 @@
#pragma once
// Distributed under the LGPL v2.1 license. See accompanying
// Distributed under the 3-Clause BSD License. See accompanying
// file LICENSE or https://github.com/CLIUtils/CLI11 for details.
// CLI Library includes

View File

@ -1,6 +1,6 @@
#pragma once
// Distributed under the LGPL v2.1 license. See accompanying
// Distributed under the 3-Clause BSD License. See accompanying
// file LICENSE or https://github.com/CLIUtils/CLI11 for details.
#include <exception>

View File

@ -1,6 +1,6 @@
#pragma once
// Distributed under the LGPL v2.1 license. See accompanying
// Distributed under the 3-Clause BSD License. See accompanying
// file LICENSE or https://github.com/CLIUtils/CLI11 for details.
#include <algorithm>

View File

@ -1,6 +1,6 @@
#pragma once
// Distributed under the LGPL v2.1 license. See accompanying
// Distributed under the 3-Clause BSD License. See accompanying
// file LICENSE or https://github.com/CLIUtils/CLI11 for details.
#include <algorithm>

View File

@ -1,6 +1,6 @@
#pragma once
// Distributed under the LGPL v2.1 license. See accompanying
// Distributed under the 3-Clause BSD License. See accompanying
// file LICENSE or https://github.com/CLIUtils/CLI11 for details.
#include <string>

View File

@ -1,6 +1,6 @@
#pragma once
// Distributed under the LGPL v2.1 license. See accompanying
// Distributed under the 3-Clause BSD License. See accompanying
// file LICENSE or https://github.com/CLIUtils/CLI11 for details.
#include <algorithm>

View File

@ -1,6 +1,6 @@
#pragma once
// Distributed under the LGPL v2.1 license. See accompanying
// Distributed under the 3-Clause BSD License. See accompanying
// file LICENSE or https://github.com/CLIUtils/CLI11 for details.
#include <chrono>

View File

@ -1,6 +1,6 @@
#pragma once
// Distributed under the LGPL v2.1 license. See accompanying
// Distributed under the 3-Clause BSD License. See accompanying
// file LICENSE or https://github.com/CLIUtils/CLI11 for details.
#include <exception>

View File

@ -1,6 +1,6 @@
#pragma once
// Distributed under the LGPL v2.1 license. See accompanying
// Distributed under the 3-Clause BSD License. See accompanying
// file LICENSE or https://github.com/CLIUtils/CLI11 for details.
#include "CLI/TypeTools.hpp"

View File

@ -40,8 +40,8 @@ def MakeHeader(out):
output = '''\
#pragma once
// Distributed under the LGPL v2.1 license. See accompanying
// file LICENSE or https://github.com/CLTools/CLI11 for details.
// Distributed under the 3-Clause BSD License. See accompanying
// file LICENSE or https://github.com/CLIUtils/CLI11 for details.
// This file was generated using MakeSingleHeader.py in CLI11/scripts
// from: {tag}