-
Notifications
You must be signed in to change notification settings - Fork 259
refactor: sshMaxArgs #1362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
refactor: sshMaxArgs #1362
Conversation
Beside the code was refactored some docstrings and code comments where added. Also the scripts output on stdout was improved. No modifications in functionality or behaviour are done.
@buhtz I have compared the old and new code (which definitely adds value via documentation). Please let me be the one to raise my hand here because
I know all my proposals are "cosmetics" but I am great fan of "literate programming" (goal: code is so easy to read that the documentation is rarely needed) and refactoring the code is a great chance for doing it now :-) |
Moin, I agree to most of your points and committed the modifications.
OK, I didn't touch it.
I kept the recursion. Asking for readability and understandability it is IMHO a matter of taste. Some like it traditional with loops and others like recursions. I always try to avoid loops, if-then-else blocks, etc. This is very easy with Python and for me feels more natural. E.g. the part where it is asked for
I'm totally into it here with you. EDIT: I followed the PEP8 naming conventions which recommends to use camel case only for class names but underscores for function and method names. Because of that it is now |
I have a question about the wording. Do we probe the command size or the length of the argument? Or is it the same? Technically the tests are done with EDIT: And being more pedantic. 😄 SSH is not the limiting factor here but the shell (on remote machine) itself set the limit. So what we do here is IMHO not probe the length of an SSH argument or command but the length of an argument/command on a remote shell using SSH. Depending on the answer to that some names could be modified. |
Yes, technically a long string is sent as argument,
Agreed, the question is if we want a function name like
I chose
PS: I think the old names may be taken from the original algorithm published eg. here (where "argument length" and "command length" is also mixed-up): https://www.theeggeadventure.com/wikimedia/index.php/Ssh_argument_length |
Thanks for your thoughts. So I understand we can just keep it as it is. Am I right? 😄 |
yes, thanks for investing your time into that! BTW: On the dev channel we should discuss if we use underscores or camel case for object names in the future... |
EDIT:
|
That looks familiar. I probably based my code on this. |
While investigating the sshMaxArg.py script and its behaviour I refactored the code and prettified it.
Beside the code was refactored some docstrings and code comments where added. Also the scripts output on stdout was improved.
No modifications in functionality or behaviour are done.
Related to #1359