From 82a9523f7113dd865e9c7c99c08fcd706231d5f1 Mon Sep 17 00:00:00 2001 From: Henry Fredrick Schreiner Date: Mon, 6 Feb 2017 14:40:52 -0500 Subject: [PATCH] Output tag too --- README.md | 4 +++- scripts/MakeSingleHeader.py | 6 +++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index f1bd30d3..10c977ab 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,9 @@ So, this library was designed to provide a great syntax, good compiler compatibi ## Installing -To use, copy CLI11.hpp into your include directory, and you are set. This is combined from the source files for every release. +To use, there are two methods. +1. Copy `CLI11.hpp` from the [most recent release](https://github.com/henryiii/CLI11/releases) into your include directory, and you are set. This is combined from the source files for every release. +2. To be added. To build the tests, get the entire directory and use CMake: diff --git a/scripts/MakeSingleHeader.py b/scripts/MakeSingleHeader.py index 5ffd87cf..43b9d5ec 100755 --- a/scripts/MakeSingleHeader.py +++ b/scripts/MakeSingleHeader.py @@ -7,6 +7,7 @@ from __future__ import print_function, unicode_literals import re import argparse from pathlib import Path +from subprocess import check_output includes_local = re.compile(r"""^#include "(.*)"$""", re.MULTILINE) includes_system = re.compile(r"""^#include \<(.*)\>$""", re.MULTILINE) @@ -14,6 +15,8 @@ includes_system = re.compile(r"""^#include \<(.*)\>$""", re.MULTILINE) DIR = Path(__file__).resolve().parent BDIR = DIR.parent / 'include' +TAG = check_output(['git', 'describe', '--tags', '--always'], cwd=str(DIR)).decode("utf-8") + def MakeHeader(out): main_header = BDIR / 'CLI/CLI.hpp' with main_header.open() as f: @@ -40,10 +43,11 @@ def MakeHeader(out): // file LICENSE or https://github.com/henryiii/CLI11 for details. // This file was generated using MakeSingleHeader.py in CLI11/scripts +// from: {tag} // This has the complete CLI library in one file. {header_list} -{output}'''.format(header_list=header_list, output=output) +{output}'''.format(header_list=header_list, output=output, tag=TAG) with Path(out).open('w') as f: f.write(output)