New functionality: adding commands of whole cli input length#2
Open
carlosrn98 wants to merge 1 commit intomasterfrom
Open
New functionality: adding commands of whole cli input length#2carlosrn98 wants to merge 1 commit intomasterfrom
carlosrn98 wants to merge 1 commit intomasterfrom
Conversation
achatur
reviewed
Feb 3, 2023
telnetsrv/telnetsrvlib.py
Outdated
| "Function decorator to define a telnet command." | ||
| def __init__(self, names, hidden=False): | ||
| if type(names) is str: | ||
| def __init__(self, names, hidden=False, has_extra_logic=True): |
Author
There was a problem hiding this comment.
yeah, I forgot to take that part out.
achatur
reviewed
Feb 3, 2023
| self.username = None | ||
| return True | ||
|
|
||
| def _get_cmd_method(self): |
There was a problem hiding this comment.
I'm confused on the usage for this though. Can't you just say if len(self.COMMANDS.alias) > 1, False, else True?
There was a problem hiding this comment.
so you're trying to see if a command is an all_input_command vs the first input being the command followed by parameters, right? If the logic for the command input sets self.alias = [] (which it does on line 194), then can't you make the assumption that if length of alias is 0, it's an all_input_command?
This new change, aside from making some small unrelated changes, adds the functionality needed for our use case of being able to add commands of the whole cli's input length. This means that we will be able to map certain input to any particular output, which hopefully will benefit our testing strategy.
4ba78ef to
79bf68d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This new change, aside from making some small unrelated changes, adds the functionality needed for our use case of being able to add commands of the whole cli's input length. This means that we will be able to map certain input to any particular output, which hopefully will benefit our testing strategy.