IDAPython 9.0
Loading...
Searching...
No Matches
cli_t Class Reference
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)
 
 unregister (self)
 
 OnExecuteLine (self, line)
 
 OnKeydown (self, line, x, sellen, vkey, shift)
 
 OnFindCompletions (self, line, x)
 

Public Attributes

 sname = sname
 
 lname = lname
 
 hint = hint
 

Detailed Description

cli_t wrapper class.

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

Constructor & Destructor Documentation

◆ __init__()

__init__ ( self)

◆ __del__()

__del__ ( self)

Member Function Documentation

◆ OnExecuteLine()

OnExecuteLine ( self,
line )
The user pressed Enter. The CLI is free to execute the line immediately or ask for more lines.

This callback is mandatory.

@param line: typed line(s)
@return Boolean: True-executed line, False-ask for more lines

◆ OnFindCompletions()

OnFindCompletions ( self,
line,
x )
The user pressed Tab. Return a list of completions

This callback is optional.

@param line: the current line (string)
@param x: the index where the cursor is (int)

@return: None if no completion could be generated, otherwise a tuple:
    (completions : Sequence[str], hints : Sequence[str], docs: Sequence[str],
      match_start: int, match_end: int)

◆ OnKeydown()

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.

This callback is optional.

@param line: current input line
@param x: current x coordinate of the cursor
@param sellen: current selection length (usually 0)
@param vkey: virtual key code. if the key has been handled, it should be returned as zero
@param shift: shift state

@return:
    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 )
Registers the CLI.

@param flags: Feature bits. No bits are defined yet, must be 0
@param sname: Short name (displayed on the button)
@param lname: Long name (displayed in the menu)
@param hint:  Hint for the input line

@return Boolean: True-Success, False-Failed

◆ unregister()

unregister ( self)
Unregisters the CLI (if it was registered)

Member Data Documentation

◆ hint

hint = hint

◆ lname

lname = lname

◆ sname

sname = sname

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