This is an archive of the discontinued LLVM Phabricator instance.

Fix tab completion for command arguments containing spaces
ClosedPublic

Authored by tberghammer on Sep 1 2015, 7:17 AM.

Details

Summary

Fix tab completion for command arguments containing spaces

If a command argument contains a space then it have to be escaped with backslash signs so the argument parsing logic can parse it properly. This CL fixes the tab completion code for the arguments to create completions with correctly escaped strings.

Diff Detail

Event Timeline

tberghammer updated this revision to Diff 33688.Sep 1 2015, 7:17 AM
tberghammer retitled this revision from to Fix tab completion for command arguments containing spaces.
tberghammer updated this object.
tberghammer added reviewers: labath, clayborg.
tberghammer added a subscriber: lldb-commits.
labath added inline comments.Sep 1 2015, 7:40 AM
source/Interpreter/Options.cpp
996

If there is any chance quotes will appear here (', ", `), you will need to escape those as well, as they are special to the command interpreter. It might be worth making a utility function out of that (Args::GetCommandInterpreterSafeArgument ?), as a canonical way to escape stuff.

tberghammer updated this revision to Diff 33692.Sep 1 2015, 8:13 AM

Address review comment (the function already exists in Args)

tberghammer updated this revision to Diff 33702.Sep 1 2015, 9:34 AM

Move escaping code to Args

clayborg accepted this revision.Sep 1 2015, 11:31 AM
clayborg edited edge metadata.

Looks good.

This revision is now accepted and ready to land.Sep 1 2015, 11:31 AM
labath accepted this revision.Sep 2 2015, 1:01 AM
labath edited edge metadata.
This revision was automatically updated to reflect the committed changes.