MCPcopy Create free account
hub / github.com/R4be1/PuppetMaster / completer

Function completer

Master.py:58–64  ·  view source on GitHub ↗
(text, state)

Source from the content-addressed store, hash-verified

56Puppet_Master = PuppetMaster()
57
58def completer(text, state):
59 func = ['cls', 'clear', 'listeners', 'handlers', 'sessions', 'execute ', 'quiet', 'close', 'history', 'exit', 'BATCH-EXECUTE ', 'use '] + [ _['hash'] for _ in Puppet_Master.sessions ]
60 matches = [ _ for _ in func if _.startswith(text) ]
61 if state < len(matches):
62 return matches[state]
63 else:
64 return None
65
66readline.parse_and_bind('tab: complete')
67readline.set_completer(completer)

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected