---
name: "shevek_args"
section: "3"
platform: "linux"
package: "libshevek-doc"
version: "1.4-1"
release: "Debian 8 (Jessie)"
platforms: ["linux"]
url: "https://new.carta.tech/shevek_args"
---

# shevek\_args(3)

Commandline and configuration file parsing helper.

## NAME

shevek::args -

Commandline and configuration file parsing helper.

## SYNOPSIS

`#include <args.hh>`

### Classes

class **option**\
 *Define an option which can be given to the program.*

### Public Member Functions

**args** (int &argc, char \*\*&argv, int min\_args, int max\_args, Glib::ustring const &description, Glib::ustring const &copyright\_years=COPYRIGHT\_YEARS, Glib::ustring const &copyright\_email=(COPYRIGHT\_EMAIL\[0\]== '\\0'?PACKAGE\_BUGREPORT:COPYRIGHT\_EMAIL), Glib::ustring const &programmer=COPYRIGHT\_AUTHOR, Glib::ustring const &email=PACKAGE\_BUGREPORT, char const \*programname=PACKAGE\_NAME, char const \*packagename=PACKAGE\_TARNAME, char const \*version=PACKAGE\_VERSION)\
 template\<unsigned size\_\> **args** (int &argc, char \*\*&argv, **option**(&o)\[size\_\], int min\_args, int max\_args, Glib::ustring const &description)\
 *Parse the commandline providing a list of possible options.*  unsigned **size** () const \
 *The number of non-option arguments.*  std::string const & **operator\[\]** (unsigned idx) const \
 *Get the non-option arguments.*  std::vector\< std::string \>\
 ::const\_iterator **begin** () const "\
 *Iterate over the non-option arguments.*  std::vector\< std::string \>\
 ::const\_iterator **end** () const "\
 *Iterate over the non-option arguments.*

## Detailed Description

Commandline and configuration file parsing helper.

Args is a commandline parsing helper. It allows giving the possible short and long options in a simple list and provides --help and --version output to the user of the program.

Usage: create an array of **shevek::args::option**, containing the desired options. create an instance of args and pass it argc and argv on the constructor. It will call all the callbacks of the options from the constructor. size () and operator\[\] can be used to access the non-option arguments.

## Constructor & Destructor Documentation

### shevek::args::args (int &argc, char \*\*&argv, intmin\_args, intmax\_args, Glib::ustring const &description, Glib::ustring const &copyright\_years = `COPYRIGHT_YEARS`, Glib::ustring const &copyright\_email = `(COPYRIGHT_EMAIL[0]== '\0'?PACKAGE_BUGREPORT:COPYRIGHT_EMAIL)`, Glib::ustring const &programmer = `COPYRIGHT_AUTHOR`, Glib::ustring const &email = `PACKAGE_BUGREPORT`, char const \*programname = `PACKAGE_NAME`, char const \*packagename = `PACKAGE_TARNAME`, char const \*version = `PACKAGE_VERSION`)

Parse the commandline. Only the default arguments (--help, -h and --version) are understood.

## Author

Generated automatically by Doxygen for libshevek from the source code.
