Blender V5.3
BLI_args.cc File Reference

A general argument parsing module. More...

#include <cctype>
#include <cstdio>
#include "MEM_guardedalloc.h"
#include "BLI_args.hh"
#include "BLI_ghash.hh"
#include "BLI_listbase.hh"
#include "BLI_string.hh"
#include "BLI_utildefines.hh"

Go to the source code of this file.

Classes

struct  blender::bArgDoc
struct  blender::bAKey
struct  blender::bArgument
struct  blender::bArgs

Namespaces

namespace  blender
 BMesh Iterators.

Macros

#define USE_DUPLICATE_ARG_WORKAROUND

Functions

static uint blender::case_strhash (const void *ptr)
static uint blender::keyhash (const void *ptr)
static bool blender::keycmp (const void *a, const void *b)
static bArgument * blender::lookUp (bArgs *ba, const char *arg, int pass, int case_str)
static void blender::args_print_wrapper (void *, const char *format, va_list args)
struct bArgs * blender::BLI_args_create (int argc, const char **argv)
void blender::BLI_args_destroy (struct bArgs *ba)
void blender::BLI_args_printf (struct bArgs *ba, const char *format,...)
void blender::BLI_args_print_fn_set (bArgs *ba, bArgPrintFn print_fn, void *user_data)
void blender::BLI_args_pass_set (struct bArgs *ba, int current_pass)
void blender::BLI_args_print (const bArgs *ba)
static bArgDoc * blender::internalDocs (bArgs *ba, const char *short_arg, const char *long_arg, const char *doc)
static void blender::internalAdd (bArgs *ba, const char *arg, int case_str, BA_ArgCallback cb, void *data, bArgDoc *d)
void blender::BLI_args_add_case (struct bArgs *ba, const char *short_arg, int short_case, const char *long_arg, int long_case, const char *doc, BA_ArgCallback cb, void *data)
void blender::BLI_args_add (struct bArgs *ba, const char *short_arg, const char *long_arg, const char *doc, BA_ArgCallback cb, void *data)
static void blender::internalDocPrint (bArgs *ba, bArgDoc *d)
void blender::BLI_args_print_arg_doc (struct bArgs *ba, const char *arg)
void blender::BLI_args_print_other_doc (struct bArgs *ba)
bool blender::BLI_args_has_other_doc (const bArgs *ba)
void blender::BLI_args_parse (struct bArgs *ba, int pass, BA_ArgCallback default_cb, void *default_data)

Variables

static char blender::NO_DOCS [] = "NO DOCUMENTATION SPECIFIED"

Detailed Description

A general argument parsing module.

Definition in file BLI_args.cc.

Macro Definition Documentation

◆ USE_DUPLICATE_ARG_WORKAROUND

#define USE_DUPLICATE_ARG_WORKAROUND

Needed so printing --help doesn't cause a naming collision with: The -a argument which is used twice. This works for argument parsing because the arguments are used in different passes, but causes problems when printing documentation which matches all passes.

NOTE(@ideasman42): Longer term we might want to avoid duplicating arguments because it's confusing and not especially helpful.

Definition at line 32 of file BLI_args.cc.