• Stars
    star
    327
  • Rank 128,686 (Top 3 %)
  • Language
    C++
  • Created over 8 years ago
  • Updated over 6 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Simple command-line options handler (C++11)

getopt

Simple command-line options handler (C++11).

Features

  • Handy, one line per option.
  • Tiny, cross-platform, self-contained, header-only.
  • ZLIB/libPNG licensed.

Showcase

#> cat sample.cc
#include <iostream>
#include <string>
#include "getopt.hpp"
int main() {
	// - No initialization required: (argc, argv) pair automatically retrieved.
	// - First argument is default option value, then all option indentifiers follow.
    bool help = getarg( false, "-h", "--help", "-?" );
    int version = getarg( 0, "-v", "--version", "--show-version" );
    int depth = getarg( 1, "-d", "--depth", "--max-depth");
    std::string file = getarg( "", "-f", "--file" );
    // [...]
    std::cout << help << ',' << file << ',' << version << std::endl;
}

#> g++ sample.cc && ./a.out --file=/a/b/c --depth=123
0, /a/b/c, 123

Changelog

  • v1.0.0 (2016/04/18): Initial version

More Repositories

1

bundle

šŸ“¦ Bundle, an embeddable compression library: DEFLATE, LZMA, LZIP, BZIP2, ZPAQ, LZ4, ZSTD, BROTLI, BSC, CSC, BCM, MCM, ZMOLLY, ZLING, TANGELO, SHRINKER, CRUSH, LZJB and SHOCO streams in a ZIP file (C++03)(C++11)
C++
623
star
2

scriptorium

šŸ“œ Game Scripting Languages benchmarked
C
486
star
3

statvs

Hopefully updated status of all my github repositories
344
star
4

AVA

A tiny unlicensed 3D game engine in C; with C++ and Lua interfaces. Written in 32 random Ģ·dĢ·aĢ·yĢ·sĢ· mĢ·oĢ·nĢ·tĢ·hĢ·sĢ· years.
C
336
star
5

sole

šŸ© Sole is a lightweight C++11 library to generate universally unique identificators (UUID), both v1 and v4.
C++
296
star
6

fsm

šŸ“‘ Simple and lightweight Hierarchical/Finite-State Machine (H-FSM) class (C++11)
C++
229
star
7

tracey

:squirrel: Tracey is a lightweight and simple C++ memory leak finder with no dependencies.
C++
226
star
8

ltalloc

LightweighT Almost Lock-Less Oriented for C++ programs memory allocator
C++
164
star
9

spot

šŸŒ€ Compact and embeddable RGBA/HSLA library that supports WEBP, JPG, progressive JPG, PNG, TGA, DDS DXT1/2/3/4/5, BMP, PSD, GIF, PVR2/3 (ETC1/PVRTC), KTX (ETC1/PVRTC), PKM (ETC1), HDR, PIC, PNM (PPM/PGM), CRN, PUG, FLIF, CCZ, EXR and vectorial SVG files (C++11)
C
134
star
10

kult

šŸ”® Lightweight entity/component/system library (C++11)
C++
127
star
11

dessert

šŸ° Lightweight unit-testing framework (C++11).
C++
87
star
12

img2sky

šŸŒ’ A vertex-color mesh builder tool for skyboxes and static geometry, as seen in HomeWorld 2 .HOD files
C
76
star
13

dollar

šŸ’° A portable CPU profiler with ASCII,CSV,TSV,Markdown,chrome://tracing support (C++11)
C++
64
star
14

base

Base91 / Base85 / Base64 de/encoders (C++03)
C++
61
star
15

trie

Trie is a lightweight and simple autocompletion data structure written in C++11.
C++
43
star
16

attila

šŸ”„ Attila is a tiny atlas texture-packer (tool)
C++
40
star
17

quant

šŸ„ Tiny quantization suite supporting conversion to/from half-floats, s/unorm bytes, quaternions and vectors (C++03).
C++
39
star
18

wire

šŸ”Œ Wire is a drop-in std::string replacement with extended functionality and safe C/C++ formatters (C++11).
C++
39
star
19

tween

šŸ‘Æ Tween is a lightweight easing library. Written in C++03
C++
35
star
20

apathy

šŸ’¾ Apathy is a lightweight path/file/mstream/mmap IO library (C++03)
C++
35
star
21

pug

šŸ¶ pug, png with a twist: lossy image format
33
star
22

malloc-survey

šŸ“ˆ Allocation benchmarks
C++
30
star
23

mINI

ā–«ļø A very minimal .INI reader/writer (C++11)
C++
29
star
24

id

:suspect: ID, a compile-time string hasher and sequential ID generator (C++11)
C++
27
star
25

LRU

A lightweight LRU cache structure for list<T> and map<K,V> containers. Written in C++11
C++
27
star
26

bubble

šŸ’¬ A simple and lightweight C++11 dialog library (for Windows)
C++
25
star
27

knot

Knot is a lightweight and simple TCP networking C++ library with no dependencies.
C++
25
star
28

sqlight

šŸ”¦ SQLight is a lightweight MySQL client written in C++11. Based on code by Ladislav Nevery
C++
25
star
29

DrEcho

šŸ’Š Dr Echo spices your terminal up (C++11)
C++
24
star
30

cocoa

šŸ« Cocoa is an uniform hashing library with no dependencies that provides interface for CRC32, CRC64, GCRC, RS, JS, PJW, ELF, BKDR, SBDM, DJB, DJB2, BP, FNV, FNV1a, AP, BJ1, MH2, SHA1, SFH (C++11)
C++
24
star
31

fmt11

Tiny format/mustache templating library (C++11)
C++
22
star
32

auth

Simple, lightweight and safe client-server authentication system. Written in C++
C++
22
star
33

bundler

šŸ“¦ Command-line archiver: DEFLATE, LZMA, LZIP, BZIP2, ZPAQ, LZ4, ZSTD, BROTLI, BSC, CSC, BCM, MCM, ZMOLLY, ZLING, TANGELO, SHRINKER, CRUSH, LZJB and SHOCO streams in a ZIP file.
C++
21
star
34

moon9

a game framework. warning: wip, dev, unstable, radiation hazard, defcon 3
C++
21
star
35

assume

šŸ™ˆ Assume is a smarter assert replacement (C++03)
C++
21
star
36

bourne

šŸ˜ Bourne is a lightweight JSON de/serializer (C++11).
C++
21
star
37

unify

šŸ”— A C++11 function to normalize resource identificators
C++
20
star
38

collage

āœ‚ļø A lightweight C++ library to diff and patch arbitrary data
C++
20
star
39

metrics

šŸ“Š Pretty table metrics w/ benchmarking, unit conversions in CSV,TSV,ASCII,markdown (C++11)
C++
19
star
40

sand

āŒ› Sand is a lightweight time controller (C++11)
C++
19
star
41

hertz

āŒš Hertz, simple framerate locker (C++11)
C++
18
star
42

frodo

šŸ’ A lightweight ring dependency system (C++11)
C++
18
star
43

giant

šŸ—æ Giant is a tiny C++11 library to handle little/big endianness.
C++
18
star
44

vle

Simple variable-length encoder/decoder (C99)(C++03)
C++
15
star
45

heal

šŸ’‰ Heal is a lightweight C++ library to aid and debug applications. Heal requires C++11 (or C++03 with boost at least).
C++
15
star
46

live

šŸŽ­ Automatic reloader of constants during runtime, featuring type inference. Written in C++11.
C++
15
star
47

crawler

Crawler, a quick prototiping platform for Windows (C++11)
C
14
star
48

units

fork of http://calumgrant.net/units (unavailable) + new units + c++0x support + markdown documentation (C++03)
C++
14
star
49

unifont

Embeddable console 1bpp font that supports many european/eastern unicode codepoints. Aimed to gamedev (C++11).
C
13
star
50

warp

ā™»ļø A handy string interpolator (C++11)
C++
13
star
51

flow

šŸŽˆ Lightweight C++ network downloader with native fallbacks. Aimed to gamedev.
C++
13
star
52

burg

Simple burg linear predictor (C++11)
C++
13
star
53

oak

šŸŒ³ A simple and lightweight tree container (C++03)
C++
13
star
54

memo

šŸ“Œ Simple and lightweight factory class, featuring automatic type casting. Written in C++11
C++
12
star
55

journey

šŸ« Lightweight append-only, header-less, journaling file format (C++11)
C++
12
star
56

route66

ā›½ Lightweight embeddable HTTP server. Written in C++11 (or C++03 w/boost).
C++
12
star
57

duty

Duty is a lightweight C++11 task manager for parallel coroutines and serial jobs. Duty requires no dependencies.
C++
10
star
58

unlzma

A very compact LZMA decoder (C++03)
C++
9
star
59

sentry

Sentry is a lightweight data monitor (C++11)
C++
9
star
60

vitae

šŸ“„ My self-compilable C++ resume
C++
9
star
61

codex

Codex is a lightweight and simple C++ library to escape, unescape, read, write and convert from/to different encoding charsets. Codex requires no dependencies.
C++
8
star
62

flare

āœØ Lightweight C++ API to deal with digital signals/logical buttons (C++03).
C++
7
star
63

solace-wip

Solace is a modern console replacement. Written in C++03
C++
6
star
64

error64

Handle custom 64-bit error codes, with extended meta-info (C, C++)
C
6
star
65

fortfont

šŸ’± Collection of western, CJK and iconographic fonts free for commercial usage
CSS
5
star
66

cash-of-clans

a free re-implementation of a working game economy system
C++
5
star
67

gpulib

C++
4
star
68

rgb332

custom uniform RGB332 palette
C++
4
star
69

hyde

šŸŽ® Hyde is a lightweight and simple Human Inferface Device (HID) C++ framework with no dependencies.
C++
4
star
70

bridge

A standard C++11 <--> C++03/boost compatibility layer, plus a few utils
C++
3
star
71

pitch

šŸ“’ A forkable game pitch template (CC0, Markdown)
3
star
72

unordered_map

Portable header for std::unordered_map<K,V> template
C++
3
star
73

variant

Variant is a varying C++11 class that clones javascript behaviour as much as possible
C++
2
star
74

emojis

:octocat: Emojis, atlased and indexed
2
star
75

CLDR

Compact data from the Unicode Common Locale Data Repository
C++
2
star
76

blender-wip

An agnostic keyframe interpolation and animation controller. Written in C++11.
C++
2
star
77

atom-wip

A small library to multiplex, to interweave, to sort, to split and to join (sub)streams of binary data (C++11).
C++
2
star
78

depot

asset depository for all my repos
C++
2
star
79

vision

a few assorted premises and thoughts
2
star
80

jabba-wip

jabba, the hud engine. yet another generic hud/ui engine
C++
2
star
81

JXMLex

JXMLex description format
1
star
82

watchmen-wip

Dependency system for your libraries of game assets in run-time
C++
1
star
83

JXML

JXML is a loss-less representation of JSON in XML, so data can be reused with XML tools.
1
star
84

rescle

Automatically exported from code.google.com/p/rescle
C++
1
star
85

tint-wip

Colorful logging tool
C++
1
star
86

stringbase

Stringbase is a collaborative effort aimed to translate common texts found in videogames and regular apps. Free to use. Commits welcome!
1
star