Using ^W
(unix-word-rubout) I can easily delete a single "word" from the current command in my bash shell.
However, when dealing with quoted arguments that contain spaces (or unquoted arguments containing backslash-escaped spaces) this doesn't work nicely as it only deletes one word and not the whole argument.
So I'm looking for a way to delete a whole argument.
Example (cursor is always at the end):
$ foo --bar "foo bar" meow
[black magic]
$ foo --bar "foo bar"
[black magic]
$ foo --bar
[black magic]
$ foo