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

# shevek\_args\_option(3)

Define an option which can be given to the program.

## NAME

shevek::args::option -

Define an option which can be given to the program.

## SYNOPSIS

`#include <args.hh>`

### Public Types

typedef sigc::slot1\< void, bool \> **callback0**\
 *Callback for options without an argument.*  typedef sigc::slot2\< void, \
 bool, Glib::ustring const & \> **callback1**"\
 *Callback for options with an argument.*

### Public Member Functions

**option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, **callback0** handle, bool \*used=NULL)\
 *Option has no argument and calls a function.*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, bool have\_default, **callback1** handle, Glib::ustring default\_val=Glib::ustring(), bool \*used=NULL)\
 *Option has mandatory argument and calls a function.*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, **callback0** handle0, **callback1** handle1, bool \*used=NULL)\
 *Option has optional argument and calls respective function.*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, bool &var, bool value, bool \*used=NULL)\
 *Set the value of a boolean variable.*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, bool have\_default, Glib::ustring &var, bool \*used=NULL)\
 *Set the value of a string variable (utf-8).*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, bool have\_default, std::string &var, bool \*used=NULL)\
 *Set the value of a string variable.*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, bool have\_default, unsigned long &var, bool \*used=NULL)\
 *Set the value of an integer variable.*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, bool have\_default, long &var, bool \*used=NULL)\
 *Set the value of an integer variable.*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, bool have\_default, unsigned &var, bool \*used=NULL)\
 *Set the value of an integer variable.*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, bool have\_default, int &var, bool \*used=NULL)\
 *Set the value of an integer variable.*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, bool have\_default, unsigned short &var, bool \*used=NULL)\
 *Set the value of an integer variable.*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, bool have\_default, short &var, bool \*used=NULL)\
 *Set the value of an integer variable.*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, bool have\_default, float &var, bool \*used=NULL)\
 *Set the value of a floating point variable.*  **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, bool have\_default, double &var, bool \*used=NULL)\
 *Set the value of a floating point variable.*  template\<typename \_T \> **option** (char shortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, std::list\< \_T \> &list)\

### Friends

class **args**\

## Detailed Description

Define an option which can be given to the program.

## Constructor & Destructor Documentation

### template\<typename \_T \> shevek::args::option::option (charshortopt, Glib::ustring const &longopt, Glib::ustring const &help\_line, std::list\< \_T \> &list)

Fill a list of variables. An item is appended to the list for each time the option is specified.

## Author

Generated automatically by Doxygen for libshevek from the source code.
