Bump to official public version.
[command.git] / README
1 # Command
2
3 C++ library for handling command line arguments.
4
5 ## Installation
6
7     $ ./autogen.sh
8     $ ./configure
9     $ make
10     $ sudo make install
11
12 ## Configuration
13
14 You need to enable c++11 support in your compiler. You can achieve that in
15 g++ and clang++ by adding `-std=c++11` compilation flag.
16
17 As this is header-only library, you don't need any additional steps.
18
19 ## Usage
20
21 example.cpp:
22
23     #include <iostream>
24     #include <command/command.h>
25     #include <command/option.h>
26
27     using namespace command;
28
29     int main(int argc, char *argv[]) {
30         try {
31             Command command(argc, argv, {
32                 new Option<void>("-h", "Help", [](void) { std::cout << "Help information\n"; })
33             });
34         }
35         catch(const std::exception & e) {
36             return 1;
37         }
38
39         return 0;
40     }
41
42 Now program can be compiled & run using following commands:
43
44     $ g++ -std=c++11 example.cpp
45     $ ./a.out -h
46     Help information
47
48 ## Documentation
49
50 Current documentation can be found at:
51 http://dlugolecki.net.pl/software/command/docs/
52
53 If for some reason it is unavailable, you can build it yourself. The only
54 requirement is to have [Doxygen](http://www.doxygen.org/) installed when `make` command is invoked.