B2R2


CmdOpts Type

A common set of command-line options used in analyzing binaries.

Constructors

Constructor Description

CmdOpts()

Full Usage: CmdOpts()

Returns: CmdOpts
Returns: CmdOpts

Instance members

Instance member Description

this.Verbose

Full Usage: this.Verbose

Verbosity

Static members

Static member Description

CmdOpts.New(descr, ?callback, ?required, ?extra, ?help, ?short, ?long, ?dummy, ?descrColor)

Full Usage: CmdOpts.New(descr, ?callback, ?required, ?extra, ?help, ?short, ?long, ?dummy, ?descrColor)

Parameters:
    descr : string
    ?callback : 'a -> Args -> 'a
    ?required : bool
    ?extra : int
    ?help : bool
    ?short : string
    ?long : string
    ?dummy : bool
    ?descrColor : ConsoleColor

Returns: 'a Option

Just a wrapper function that instantiate an OptParse.Option object.

descr : string
?callback : 'a -> Args -> 'a
?required : bool
?extra : int
?help : bool
?short : string
?long : string
?dummy : bool
?descrColor : ConsoleColor
Returns: 'a Option

CmdOpts.OptHelp()

Full Usage: CmdOpts.OptHelp()

Returns: 'a Option

"-h" or "--help" option.

Returns: 'a Option

CmdOpts.OptVerbose()

Full Usage: CmdOpts.OptVerbose()

Returns: 'a Option

"-v" or "--verbose" option turns on the verbose mode.

Returns: 'a Option

CmdOpts.ParseAndRun(mainFn) (tool) (usageTail) (spec) (opts) (args)

Full Usage: CmdOpts.ParseAndRun(mainFn) (tool) (usageTail) (spec) (opts) (args)

Parameters:
    mainFn : string list -> 'a -> unit
    tool : 'b
    usageTail : string
    spec : 'a Spec
    opts : 'a
    args : Args

Returns: int

Parse command line arguments, and run the mainFn

mainFn : string list -> 'a -> unit
tool : 'b
usageTail : string
spec : 'a Spec
opts : 'a
args : Args
Returns: int

CmdOpts.PrintUsage(tool) (usageTail) (spec)

Full Usage: CmdOpts.PrintUsage(tool) (usageTail) (spec)

Parameters:
    tool : 'a
    usageTail : string
    spec : 'b Spec

Returns: 'c
tool : 'a
usageTail : string
spec : 'b Spec
Returns: 'c

CmdOpts.SanitizeRestArgs(args)

Full Usage: CmdOpts.SanitizeRestArgs(args)

Parameters:
    args : string list

Check if the rest args contain an option string. If so, exit the program. Otherwise, do nothing.

args : string list

CmdOpts.WriteB2R2(newLine)

Full Usage: CmdOpts.WriteB2R2(newLine)

Parameters:
    newLine : bool

Write B2R2 logo to console. We can selectively append a new line at the end.

newLine : bool