PStack  2.0
Stack trace printer for MSVC and GCC binaries
pstack_options.cpp File Reference

Define the command-line options interface for the PStack application. More...

#include "pstack/pstack_options.hpp"
#include <climits>
#include <iostream>
#include <psystem/framework/iomanip.hpp>
#include <psystem/exception/ui_exception.hpp>
Include dependency graph for pstack_options.cpp:

Classes

struct  pstack::pstack_options::options_data
 The full set of options information available to pstack::pstack_options. More...
 

Namespaces

 anonymous_namespace{pstack_options.cpp}
 Data local to this compilation unit.
 
 pstack
 Contains modules that make up the PStack stack-printing application.
 

Variables

pstack::pstack_optionsanonymous_namespace{pstack_options.cpp}::g_options = nullptr
 The options block is supposed to be a singleton. More...
 

Convenience Macros

#define MAKE_OPTION_FLAG(opt)   "-" opt
 Creates a string for a command-line flag. More...
 
#define PRINT_OPTION(opt, desc)
 Used to print a help option. More...
 
#define PRINT_OPTION_FLAG(opt, desc)
 Used to print a help option for a "flag.". More...
 
#define PRINT_INDENTED(desc)    std::cout << " " << desc << '\n'
 Print the continuation of a description in the help option output. More...
 

Detailed Description

Define the command-line options interface for the PStack application.

Author
Matt Bisson
Date
25 November, 2007 – 5 August, 2014
Since
PStack 1.0
Version
PStack 2.0

Macro Definition Documentation

#define MAKE_OPTION_FLAG (   opt)    "-" opt

Creates a string for a command-line flag.

This is done by by appending the platform-specific option flag starting token (i.e., '-' in a "-h" flag) to the opt parameter.

Parameters
optThe option flag — it should be a single letter to qualify as a "flag." This must be a quoted C string literal.
#define PRINT_INDENTED (   desc)    std::cout << " " << desc << '\n'

Print the continuation of a description in the help option output.

Parameters
descThe text to print after the indentation.
#define PRINT_OPTION (   opt,
  desc 
)
Value:
std::cout \
<< " " << std::setw(11) << std::left << opt \
<< ' ' << desc << '\n'

Used to print a help option.

Parameters
optThe option (as the user would specify it).
descA description of the option.
#define PRINT_OPTION_FLAG (   opt,
  desc 
)
Value:
std::cout \
<< " " << std::setw(11) << std::left << MAKE_OPTION_FLAG(opt) \
<< ' ' << desc << '\n'
#define MAKE_OPTION_FLAG(opt)
Creates a string for a command-line flag.
Definition: pstack_options.cpp:42

Used to print a help option for a "flag.".

A "flag" in this context is a single-letter command-line argument.

Parameters
optThe single letter for the flag.
descA description of the option.