-
Notifications
You must be signed in to change notification settings - Fork 127
Added a shlex.split() wrapper to have a common way of calling it. #638
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
Conversation
Replaced parse_quoted_string with _get_command_arg_list.
Codecov Report
@@ Coverage Diff @@
## master #638 +/- ##
==========================================
+ Coverage 94.22% 94.23% +0.01%
==========================================
Files 11 11
Lines 3014 3020 +6
==========================================
+ Hits 2840 2846 +6
Misses 174 174
Continue to review full report at Codecov.
|
tleonhardt
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See my comments
| from .argparse_completer import AutoCompleter, ACArgumentParser, ACTION_ARG_CHOICES | ||
| from .clipboard import can_clip, get_paste_buffer, write_to_paste_buffer | ||
| from .parsing import StatementParser, Statement, Macro, MacroArg | ||
| from .history import History, HistoryItem |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Changes look good
|
Now that it's merged, here's my comment on the question @kmvanbrunt asked above, i.e. what's the use case for duplicate argils decorators on a single method. It was just an application of Postel's law, which is: be conservative in what you do, be liberal in what you accept from others. I have no use case for why you would need two decorators on the method, but since it was trivial to ensure that our decorator didn't break or give unexpected behavior if someone did apply it twice, I tested for it and make sure it worked. |
This is pretty much a refactor that provides a common way of calling
shlex.split()to ensure the same arguments are always used for consistent parsing.I also replaced
parse_quoted_string()with_get_command_arg_list(). I believe the name and documentation of this function better communicates its purpose. This function also doesn't bother callingshlex.split()on an already parsedStatementobject.@kotfu I removed a unit test called
test_arglist_decorator_twice. Is that an OK change? I wasn't sure the use case of having twowith_argument_listdecorators on one method. Let me know if I need to put it back and make the new code work with it. It would be a trivial fix for me.