Header menu logo B2R2

CmdOpts Module

Provides utility functions for parsing command line options.

Functions and values

Function or value Description

parseAndRun mainFn tool usageTail spec opts args

Full Usage: parseAndRun mainFn tool usageTail spec opts args

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

Returns: int

Parses command line arguments and runs the mainFn

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

printUsage tool usageTail spec

Full Usage: printUsage tool usageTail spec

Parameters:
    tool : 'a
    usageTail : string
    spec : CmdOpt<'b> list

Returns: 'c

Prints out the usage message for the given tool.

tool : 'a
usageTail : string
spec : CmdOpt<'b> list
Returns: 'c

sanitizeRestArgs args

Full Usage: sanitizeRestArgs args

Parameters:
    args : string list

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

args : string list

writeB2R2 printNewLine

Full Usage: writeB2R2 printNewLine

Parameters:
    printNewLine : bool

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

printNewLine : bool

writeIntro ()

Full Usage: writeIntro ()

Parameters:
    () : unit

Writes introduction message to console.

() : unit

Type something to start searching.