aboutsummaryrefslogtreecommitdiffstats
path: root/test/mitmproxy/test_command.py
Commit message (Collapse)AuthorAgeFilesLines
* fix #3801Maximilian Hils2020-02-041-1/+8
|
* coverage++Maximilian Hils2019-11-181-1/+23
|
* adjust testMaximilian Hils2019-11-181-1/+1
|
* revamp command processingMaximilian Hils2019-11-181-108/+142
| | | | | | | | | | | | - Display the parameter name instead of the parameter type whenver users interact with commands. This makes it easy to enter commands just by their signature. We may want to expose type information in the command list, but some quick testing showed that this are rather intuitive anyways. - Add shift tab backward cycling for the command completion. - Use inspect.Signature instead of homebrew argument matching solution. This gets rid of quite a bit of cruft. - Remove some type checking hacks in mitmproxy.types
* Added coverage for the changes madeHenrique2019-11-171-0/+4
|
* Fixing issues pointed during PR reviewHenrique2019-11-161-7/+7
|
* Removed the custom lexer in favor of using pyparsing.Henrique2019-11-151-29/+124
|
* Added tests to reach 100% coverageHenrique2019-11-131-1/+5
|
* Fix for issues when using \ and " on the commander barHenrique2019-11-121-4/+4
|
* View API slightly extended; codebase cleaned in some pointsmadt1m2018-06-131-1/+1
|
* command: handle string without terminal escaped charAldo Cortesi2018-05-121-0/+2
| | | | Fixes #2810
* commands: handle type errors on startupAldo Cortesi2018-05-121-3/+29
| | | | | fixes #3088 fixes #2787
* commands: if no explicit return type is specified, assume NoneAldo Cortesi2018-05-121-0/+13
| | | | | This is going to be a super common error for addon authors, so we might as well handle it.
* commands: clarify command call interface, fix web app replayAldo Cortesi2018-05-021-8/+11
|
* adding commandkira02042018-03-121-3/+5
|
* Testing using addonkira02042018-03-121-11/+17
|
* fixing lintkira02042018-03-071-3/+3
|
* using assertskira02042018-03-071-0/+3
|
* wrong additionskira02042018-03-061-0/+14
| | | | | | | | | | test-for-2850 few fixes mock testing Typo error
* Fix an issue with quoting and commandsAldo Cortesi2018-02-231-0/+16
| | | | | Previously, quotes would disappear during editing, making it impossible to enter command arguments with spaces.
* commander: command argument underlayAldo Cortesi2017-12-201-0/+71
| | | | Display context-sensitive argument types as an "underlay" in commander.
* commander: palette entries, highlight errorsAldo Cortesi2017-12-201-2/+6
| | | | | | | - Add palette entries specific to commander - Highlight errors - Introduce an Unknown type to keep track of extra unknown arguments to commands
* commands: partial parser now returns help for remaining argumentsAldo Cortesi2017-12-191-56/+34
|
* types: add validation to partial parserAldo Cortesi2017-12-191-15/+15
|
* types: use new type validation mechanism in commandsAldo Cortesi2017-12-191-12/+1
|
* commands: refactor typesAldo Cortesi2017-12-181-28/+25
| | | | | | | The type system was scattered over a number of places, making it hard to follow. This collects all command types in types.py, and completion, validation and parsing for each type is centralised. We should use the same mechanism for options.
* commands: minor refactoring and command renamingAldo Cortesi2017-12-171-10/+9
|
* minor: fix key bindings, adjust flow command presentationAldo Cortesi2017-12-171-1/+1
| | | | Fixes #2681
* commands: Reassess the cuts APIAldo Cortesi2017-12-171-1/+1
| | | | | Make the cuts API more transparent. Cut specifications are no longer a centrally resolved core type, and flows are now passed explicitly.
* command: recursive command parsingAldo Cortesi2017-12-151-0/+19
| | | | This lets us complete commands passed to commands correctly.
* commands: emit types from partial parser, implement choice completionAldo Cortesi2017-12-151-2/+22
|
* WIP: autocompletionAldo Cortesi2017-12-151-2/+16
|
* commands: add a parser for partial commandsAldo Cortesi2017-12-151-0/+10
| | | | We only return Cmd and str types for the moment.
* commands: add a Cmd argument typeAldo Cortesi2017-12-151-0/+4
| | | | | | This represents a command passed as an argument. Also split arguments from command values themselves, making the command help for meta-commands much clearer.
* adjust testsMaximilian Hils2017-12-141-8/+16
|
* commands: add a Path argument typeAldo Cortesi2017-12-131-0/+8
| | | | | | | This is just an alias for str, and in this patch is used mostly to give an appropriate type in help strings. More to come. Fixes #2198
* commands: formalise a Choice typeAldo Cortesi2017-12-131-0/+22
| | | | | | | | | This resolves as a string during MyPy checks, but at runtime has an additional attribute that is a command that returns valid options. This is very ugly and clumsy, basically because MyPy is super restrictive about what it accepts as a type. Almost any attempt to construct these types in a more sophisticated way fails in one way or another. I'm open to suggestions.
* commands: verify command function signatures before call (#2659)Aldo Cortesi2017-12-111-0/+7
| | | Fixes #2652, and many other possible crashes on user input.
* commands: teach parser correct annotations for variable argsAldo Cortesi2017-06-131-1/+1
| | | | We should annotate with the base type, not the resulting sequence.
* commands: support *args for commandsAldo Cortesi2017-04-301-17/+36
| | | | | | Use this to simplify meta-commands in console, and to create a console_choose command that prompts the user for a choice, and then executes a command with variable substitution.
* Move export to addon, kill Python and Locust exportAldo Cortesi2017-04-301-0/+1
| | | | | | | | | | Also add a "raw" export format. The Python and Locust exports are hard to maintain, their tests are extremely brittle, they didn't have full test coverage, and are by my guess very rarely used. I feel the Locust export should certainly be an externally maintained addon. The Python/requests export can come back if someone cares enough, and it can be structured in a way we can maintain.
* Add help text to --commands outputAldo Cortesi2017-04-301-0/+5
|
* Introduce cuts: a flow dissectorAldo Cortesi2017-04-291-0/+12
| | | | | | | | | | | | | | | | | This PR introduces the cuts addon, a flow dissector that allows you to select and operate on specific components of flows. It also adds the first consumer for cuts - the cuts.save command. Save the content of the focus to /tmp/foo: cuts.save s.content|@focus /tmp/foo Save the URL and response content-type headers for all flows currently shown to file, comma-separated, one flow per line: cuts.save s.url,q.header[content-type]|@focus /tmp/foo We also use this to replace the body save shortcut in the console flowlist.
* commands: markingAldo Cortesi2017-04-291-0/+6
| | | | | Add "view.mark [flows] bool" and "view.mark.toggle [flows]". Use this to rebind marking keys in flowlist.
* commands: view.goAldo Cortesi2017-04-291-0/+4
| | | | | bind G to "view.go -1" bind g to "view.go 0"
* Commands, core update eventAldo Cortesi2017-04-291-1/+1
| | | | | | | | | | | | | | | This patch: - Introduces a core update() event that should be invoked whenever flows are changed outside of the normal lifecycle. - Extend view.resolve to know about @all, which matches all flows in the view. - Add a core flow.resume comand, which resumes flows and broadcasts an update event. - Define flow list bindings for: A -> flow.resume @all a -> flow.resume @focus d -> view.remove @focus z -> view.remove @all
* commands: add a command.command decoratorAldo Cortesi2017-04-281-16/+45
| | | | Use this for our built-ins and the console commands.
* Support unary flow command argumentsAldo Cortesi2017-04-281-3/+10
| | | | Use this to add a console.view.flow command and bind "enter" in flowlist.
* console: add a keymapAldo Cortesi2017-04-281-0/+6
| | | | | This sketches out a keymap system for consone, and adds the first few top-level commands and mappings.
* console: interactive command browserAldo Cortesi2017-04-281-0/+2
| | | | | Simple browser that lets users view and select commands interactively. Key binding for this is still to be sorted out.