← All tools

argtable3

Popularity 85 Updated Development & Build

ANSI C library for parsing GNU-style command-line options

homebrewauto-collected

Installation

Homebrew
brew install argtable3

Install with Homebrew.

Introduction of Argtable3 =========================

Argtable3 is an open-source ANSI C library that simplifies parsing GNU-style command-line options. It provides a declarative API to define your command-line syntax, and because it's built on the standard getopt library, it ensures 100% GNU-compliant behavior. Argtable3 automatically generates the error-handling logic and usage descriptions that are essential for any robust command-line program, saving you from tedious boilerplate code.

Quick Start -----------

There are several ways to use Argtable3 in your C/C++ projects:

  • Embed Amalgamation Source Files: Download the amalgamation package and

include argtable3.c and argtable3.h in your project. This is the simplest and recommended approach.

  • Use vcpkg: Add Argtable3 as a dependency in your project's vcpkg manifest

for single-project use, or install it globally with vcpkg for system-wide access.

  • Use Meson WrapDB: Integrate Argtable3 into Meson-based projects using the

Meson WrapDB.

  • Use Conan: Add Argtable3 as a dependency in your Conanfile for projects

using Conan package management.

  • Build from Source: Download release archives or clone the repository to

build Argtable3 manually. This is ideal for contributors or those needing custom features.

Embed Amalgamation Source Files

Download the amalgamation package from the release page and add argtable3.c and argtable3.h to your project. This approach is the simplest and recommended way to use Argtable3, as it eliminates the need to build the library and enables better inter-procedural optimization by the compiler.

Use vcpkg for a Single Project

vcpkg is an open source C/C++ package manager based on CMake, and it supports the latest releases of Argtable3. To add the library to your CMake project, it's recommended to add vcpkg as a submodule to your project repo and use it to manage project dependencies. All libraries installed in this way can only be consumed by the project and won't impact other projects in the system.