pre parse the arguments from the line using precmd
eliminates superfluous do_ commands, by allowing the leading argument to pass through
passes a persistent SWAT object through all commands, to accept and set arguments from within commands
this includes the CredStore, which allows setting creds by calling self.obj.add_creds(key, value) and to use them by simply calling self.obj.cred_store.name_of_cred
sets up custom help rendering
standardizes help parsing and argparse setting
Details
The persistent obj cleans up parameters by storing them within
Help output
authenticate and data
print the class docstrings
no need for parser since no args
clearexit
builtin do_ commands
print method docstrings
coverage
print parser help
defined parser because it has args
emulate
prints the custom defined custom_help method
emulate t1098
prints the parser
all emulations must define a parser
intentional errors (helllll, help helllll, help emulate fakeeeee
help * passes through custom help logic (do_help)
unknown command handle by load_command, passing to logger
resolves #38
This PR refactors the Shell to
precmd
do_
commands, by allowing the leading argument to pass throughSWAT
object through all commands, to accept and set arguments from within commandsCredStore
, which allows setting creds by callingself.obj.add_creds(key, value)
and to use them by simply callingself.obj.cred_store.name_of_cred
Details
The persistent obj cleans up parameters by storing them within
Help output
authenticate
anddata
clear
exit
do_
commandscoverage
emulate
custom_help
methodemulate t1098
intentional errors (
helllll
,help helllll
,help emulate fakeeeee
do_help
)load_command
, passing to logger