← 全部工具

synesissoftware/libCLImate

热度 70 更新于 开发与构建

Command-Line Interface boilerplate mini-framework

githubauto-collected

安装

暂未验证可直接使用的安装命令,请查看项目官方文档或 Release。

libCLImate <!-- omit in toc --

Portable, lightweight mini-framework for Command-Line Interface boilerplate.

[](https://opensource.org/licenses/BSD-3-Clause) [](https://github.com/synesissoftware/libCLImate/releases/latest) [](https://github.com/synesissoftware/libCLImate/commits/master) [](https://github.com/synesissoftware/libCLImate/actions/workflows/ci.yml)

Table of Contents <!-- omit in toc --

  • Introduction
  • Installation
  • Components
  • C API
  • C++ API
  • Examples
  • Project Information
  • Where to get help
  • Contribution guidelines
  • Dependencies
  • Related projects
  • License

Introduction

libCLImate is a portable, lightweight mini-framework that encapsulates the common aspects of Command-Line Interface boilerplate, including:

  • command-line argument parsing and sorting (using the CLASP library);
  • diagnostic logging library (Pantheios) initialisation / lifetime scoping;
  • provision of de-facto standard CLI facilities, such as responding to '--help' and '--version' flags;

Installation

Detailed instructions — via CMake — are provided in the accompanying INSTALL.md file.

Components

C API

The primary C headers live under include/libclimate/:

  • libclimate/common.h — common include (pulls in version.h);
  • libclimate/version.h — LIBCLIMATEVER version macros;
  • libclimate/main.h — implicit-main include; defines main() in terms of libCLImatemainentrypointC();
  • libclimate/main/api.h — explicit-main API:
  • libCLImateprogrammain() — application entry callback;
  • libCLImatemainentrypointC() — explicit main() implementation;
  • libCLImateshowusage() / libCLImateshowversion() — stock --help / --version support;
  • libCLImatespecifications[] — application-defined CLASP alias array;

C++ API

The C++ API builds on the C API: