IDAPython 8.4
Loading...
Searching...
No Matches
cli_t Class Reference

cli_t wrapper class. More...

Inheritance diagram for cli_t:
pyidc_opaque_object_t

Public Member Functions

 __init__ (self)
 
 __del__ (self)
 
 register (self, flags=0, sname=None, lname=None, hint=None)
 Registers the CLI.
 
 unregister (self)
 Unregisters the CLI (if it was registered)
 
 OnExecuteLine (self, line)
 The user pressed Enter.
 
 OnKeydown (self, line, x, sellen, vkey, shift)
 A keyboard key has been pressed This is a generic callback and the CLI is free to do whatever it wants.
 
 OnCompleteLine (self, prefix, n, line, prefix_start)
 The user pressed Tab.
 

Public Attributes

 sname = sname
 
 lname = lname
 
 hint = hint
 

Detailed Description

This class allows you to implement your own command line interface handlers.

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self)

◆ __del__()

__del__ ( self)

Member Function Documentation

◆ OnCompleteLine()

OnCompleteLine ( self,
prefix,
n,
line,
prefix_start )

Find a completion number N for prefix PREFIX

This callback is optional.

Parameters
prefixLine prefix at prefix_start (string)
ncompletion number (int)
linethe current line (string)
prefix_startthe index where PREFIX starts in LINE (int)
Returns
: None if no completion could be generated otherwise a String with the completion suggestion

◆ OnExecuteLine()

OnExecuteLine ( self,
line )

The CLI is free to execute the line immediately or ask for more lines.

This callback is mandatory.

Parameters
linetyped line(s)
Returns
: Boolean: True-executed line, False-ask for more lines

◆ OnKeydown()

OnKeydown ( self,
line,
x,
sellen,
vkey,
shift )

This callback is optional.

Parameters
linecurrent input line
xcurrent x coordinate of the cursor
sellencurrent selection length (usually 0)
vkeyvirtual key code. if the key has been handled, it should be returned as zero
shiftshift state
Returns
: None - Nothing was changed tuple(line, x, sellen, vkey): if either of the input line or the x coordinate or the selection length has been modified. It is possible to return a tuple with None elements to preserve old values. Example: tuple(new_line, None, None, None) or tuple(new_line)

◆ register()

register ( self,
flags = 0,
sname = None,
lname = None,
hint = None )
Parameters
flagsFeature bits. No bits are defined yet, must be 0
snameShort name (displayed on the button)
lnameLong name (displayed in the menu)
hintHint for the input line
Returns
: Boolean: True-Success, False-Failed

◆ unregister()

unregister ( self)

Member Data Documentation

◆ hint

hint = hint

◆ lname

lname = lname

◆ sname

sname = sname

The documentation for this class was generated from the following file: