# popt/popthelp.c File Reference

More...

`#include "system.h"`
`#include "poptint.h"`

Go to the source code of this file.

## Functions

void | displayArgs (poptContext con, enum poptCallbackReason foo, struct poptOption *key, const char *arg, void *data)
const char *const | getTableTranslationDomain (const struct poptOption *table)
const char *const | getArgDescrip (const struct poptOption *opt, const char *translation_domain)
char * | singleOptionDefaultValue (int lineLength, const struct poptOption *opt, const char *translation_domain)
void | singleOptionHelp (FILE *fp, int maxLeftCol, const struct poptOption *opt, const char *translation_domain)
int | maxArgWidth (const struct poptOption *opt, const char *translation_domain)
void | itemHelp (FILE *fp, poptItem items, int nitems, int left, const char *translation_domain)
| Display popt alias and exec help.
void | singleTableHelp (poptContext con, FILE *fp, const struct poptOption *table, int left, const char *translation_domain)
int | showHelpIntro (poptContext con, FILE *fp)
void | poptPrintHelp (poptContext con, FILE *fp, int flags)
int | singleOptionUsage (FILE *fp, int cursor, const struct poptOption *opt, const char *translation_domain)
int | itemUsage (FILE *fp, int cursor, poptItem item, int nitems, const char *translation_domain)
| Display popt alias and exec usage.
int | singleTableUsage (poptContext con, FILE *fp, int cursor, const struct poptOption *opt, const char *translation_domain)
int | showShortOptions (const struct poptOption *opt, FILE *fp, char *str)
| Return concatenated short options for display.
void | poptPrintUsage (poptContext con, FILE *fp, int flags)
void | poptSetOtherOptionHelp (poptContext con, const char *text)

## Variables

poptOption | poptAliasOptions []
| Empty table marker to enable displaying popt alias/exec options.
poptOption | poptHelpOptions []
| Auto help table options.

## Detailed Description

Definition in file popthelp.c.

## Function Documentation

void displayArgs | ( | poptContext | con,
|  | enum poptCallbackReason | foo,
|  | struct poptOption * | key,
|  | const char * | arg,
|  | void * | data
| ) | `[static]`

Parameters:

  con | context
  key | option(s)

Definition at line 19 of file popthelp.c.

References poptContext, poptPrintHelp(), poptPrintUsage(), and poptOption::shortName.

const char* const getArgDescrip | ( | const struct poptOption * | opt,
|  | const char * | translation_domain
| ) | `[static]`

Parameters:

  opt | option(s)
  translation_domain | translation domain

Definition at line 85 of file popthelp.c.

References poptOption::argDescrip, poptOption::argInfo, D_, POPT_, POPT_ARG_DOUBLE, POPT_ARG_FLOAT, POPT_ARG_INT, POPT_ARG_LONG, POPT_ARG_MASK, POPT_ARG_NONE, POPT_ARG_STRING, POPT_ARG_VAL, and poptHelpOptions.

Referenced by maxArgWidth(), singleOptionHelp(), and singleOptionUsage().

const char* const getTableTranslationDomain | ( | const struct poptOption * | table | ) | `[static]`

Parameters:

  table | option(s)

Definition at line 67 of file popthelp.c.

References poptOption::longName, and POPT_ARG_INTL_DOMAIN.

Referenced by singleTableHelp().

void itemHelp | ( | FILE * | fp,
|  | poptItem | items,
|  | int | nitems,
|  | int | left,
|  | const char * | translation_domain
| ) | `[static]`

Display popt alias and exec help.

Parameters:

  fp | output file handle
  items | alias/exec array
  nitems | no. of alias/exec entries
  translation_domain | translation domain

Definition at line 387 of file popthelp.c.

References POPT_ARGFLAG_DOC_HIDDEN, poptItem, and singleOptionHelp().

Referenced by singleTableHelp().

int itemUsage | ( | FILE * | fp,
|  | int | cursor,
|  | poptItem | item,
|  | int | nitems,
|  | const char * | translation_domain
| ) | `[static]`

Display popt alias and exec usage.

Parameters:

  fp | output file handle
  item | alias/exec array
  nitems | no. of ara/exec entries
  translation_domain | translation domain

Definition at line 540 of file popthelp.c.

References poptOption::arg, poptItem_s::option, POPT_ARG_INTL_DOMAIN, POPT_ARG_MASK, POPT_ARGFLAG_DOC_HIDDEN, poptItem, and singleOptionUsage().

Referenced by poptPrintUsage().

int maxArgWidth | ( | const struct poptOption * | opt,
|  | const char * | translation_domain
| ) | `[static]`

Parameters:

  opt | option(s)
  translation_domain | translation domain

Definition at line 343 of file popthelp.c.

References poptOption::arg, poptOption::argInfo, getArgDescrip(), poptOption::longName, POPT_ARG_INCLUDE_TABLE, POPT_ARG_MASK, POPT_ARGFLAG_DOC_HIDDEN, POPT_ARGFLAG_ONEDASH, POPT_ARGFLAG_OPTIONAL, and poptOption::shortName.

Referenced by poptPrintHelp().

int showHelpIntro | ( | poptContext | con,
|  | FILE * | fp
| ) | `[static]`

Parameters:

  con | context
  fp | output file handle

Definition at line 452 of file popthelp.c.

References optionStackEntry::argv, poptContext_s::flags, poptContext_s::optionStack, POPT_, POPT_CONTEXT_KEEP_FIRST, and poptContext.

Referenced by poptPrintHelp(), and poptPrintUsage().

int showShortOptions | ( | const struct poptOption * | opt,
|  | FILE * | fp,
|  | char * | str
| ) | `[static]`

Return concatenated short options for display.

Parameters:

  opt | option(s)
  fp | output file handle

Return values:

  str | concatenation of short options

Returns:
  length of display string

Definition at line 601 of file popthelp.c.

References alloca(), poptOption::arg, poptOption::argInfo, poptOption::longName, POPT_ARG_INCLUDE_TABLE, POPT_ARG_MASK, and poptOption::shortName.

Referenced by poptPrintUsage().

char* singleOptionDefaultValue | ( | int | lineLength,
|  | const struct poptOption * | opt,
|  | const char * | translation_domain
| ) | `[static]`

Parameters:

  opt | option(s)
  translation_domain | translation domain

Definition at line 115 of file popthelp.c.

References _free(), poptOption::arg, poptOption::argInfo, D_, POPT_ARG_DOUBLE, POPT_ARG_FLOAT, POPT_ARG_INT, POPT_ARG_LONG, POPT_ARG_MASK, POPT_ARG_NONE, POPT_ARG_STRING, and POPT_ARG_VAL.

Referenced by singleOptionHelp().

void singleOptionHelp | ( | FILE * | fp,
|  | int | maxLeftCol,
|  | const struct poptOption * | opt,
|  | const char * | translation_domain
| ) | `[static]`

Parameters:

  fp | output file handle
  opt | option(s)
  translation_domain | translation domain

Definition at line 182 of file popthelp.c.

References _free(), poptOption::argDescrip, poptOption::argInfo, D_, poptOption::descrip, getArgDescrip(), poptOption::longName, ops, POPT_ARG_DOUBLE, POPT_ARG_FLOAT, POPT_ARG_INT, POPT_ARG_LONG, POPT_ARG_MASK, POPT_ARG_NONE, POPT_ARG_STRING, POPT_ARG_VAL, POPT_ARGFLAG_AND, POPT_ARGFLAG_LOGICALOPS, POPT_ARGFLAG_NOT, POPT_ARGFLAG_ONEDASH, POPT_ARGFLAG_OPTIONAL, POPT_ARGFLAG_OR, POPT_ARGFLAG_SHOW_DEFAULT, POPT_ARGFLAG_XOR, poptOption::shortName, singleOptionDefaultValue(), and poptOption::val.

Referenced by itemHelp(), and singleTableHelp().

int singleOptionUsage | ( | FILE * | fp,
|  | int | cursor,
|  | const struct poptOption * | opt,
|  | const char * | translation_domain
| ) | `[static]`

Parameters:

  fp | output file handle
  opt | option(s)
  translation_domain | translation domain

Definition at line 492 of file popthelp.c.

References poptOption::argInfo, getArgDescrip(), poptOption::longName, POPT_ARG_MASK, POPT_ARGFLAG_ONEDASH, and poptOption::shortName.

Referenced by itemUsage(), and singleTableUsage().

void singleTableHelp | ( | poptContext | con,
|  | FILE * | fp,
|  | const struct poptOption * | table,
|  | int | left,
|  | const char * | translation_domain
| ) | `[static]`

Parameters:

  fp | output file handle
  table | option(s)
  translation_domain | translation domain

Definition at line 411 of file popthelp.c.

References poptContext_s::aliases, D_, poptContext_s::execs, getTableTranslationDomain(), itemHelp(), poptContext_s::numAliases, poptContext_s::numExecs, POPT_ARG_INCLUDE_TABLE, POPT_ARG_MASK, POPT_ARGFLAG_DOC_HIDDEN, poptAliasOptions, poptContext, and singleOptionHelp().

Referenced by poptPrintHelp().

int singleTableUsage | ( | poptContext | con,
|  | FILE * | fp,
|  | int | cursor,
|  | const struct poptOption * | opt,
|  | const char * | translation_domain
| ) | `[static]`

Parameters:

  fp | output file handle
  opt | option(s)
  translation_domain | translation domain

Definition at line 569 of file popthelp.c.

References poptOption::arg, poptOption::argInfo, poptOption::longName, POPT_ARG_INCLUDE_TABLE, POPT_ARG_INTL_DOMAIN, POPT_ARG_MASK, POPT_ARGFLAG_DOC_HIDDEN, poptContext, poptOption::shortName, and singleOptionUsage().

Referenced by poptPrintUsage().

## Variable Documentation

struct poptOption poptHelpOptions[]

Initial value:

     {
      { NULL, '\0', POPT_ARG_CALLBACK, (void *)&displayArgs, '\0', NULL, NULL },
      { "help", '?', 0, NULL, '?',  "Show this help message" , NULL },
      { "usage", '\0', 0, NULL, 'u',  "Display brief usage message" , NULL },

        POPT_TABLEEND
    }

Auto help table options.

Definition at line 51 of file popthelp.c.

Referenced by getArgDescrip().