Skip to contents

IndentedHelpFormatter() is the default help text formatter. TitledHelpFormatter() is an alternative help text formatter.

Usage

IndentedHelpFormatter(object)

TitledHelpFormatter(object)

Arguments

object

An OptionParser() object.

Value

NULL invisibly. As a side effect prints out help text.

Examples

 parser <- OptionParser(formatter = IndentedHelpFormatter)
 parser <- add_option(parser, "--generator", help = "Generator option")
 parser <- add_option(parser, "--count", help = "Count option")
 print_help(parser)
#> Usage: %prog [options]
#> 
#> 
#> Options:
#> 	-h, --help
#> 		Show this help message and exit
#> 
#> 	--generator=GENERATOR
#> 		Generator option
#> 
#> 	--count=COUNT
#> 		Count option
#> 
#> 

 parser <- OptionParser(formatter = TitledHelpFormatter)
 parser <- add_option(parser, "--generator", help = "Generator option")
 parser <- add_option(parser, "--count", help = "Count option")
 print_help(parser)
#> Usage
#> =====
#>  %prog [options]
#> 
#> 
#> Options
#> =======
#> --help, -h
#> 		Show this help message and exit
#> 
#> --generator=GENERATOR
#> 		Generator option
#> 
#> --count=COUNT
#> 		Count option
#> 
#>