This is an archive of the discontinued LLVM Phabricator instance.

Add -relative-to-command-file to "command source"
ClosedPublic

Authored by jingham on Sep 27 2021, 5:57 PM.

Details

Summary

This option was recently added to "command script import" so that an "organizing" command file can find python script files relative to itself. It's natural to extend this to command files as well as script source files for much the same reason.

Diff Detail

Event Timeline

jingham created this revision.Sep 27 2021, 5:57 PM
jingham requested review of this revision.Sep 27 2021, 5:57 PM
Herald added a project: Restricted Project. · View Herald TranscriptSep 27 2021, 5:57 PM

The one thing that makes me sad about this is that "command script import" chose "-c" as the short letter for this option, but "-c" was already taken for "command source", so I used -C for "command source".

The one thing that makes me sad about this is that "command script import" chose "-c" as the short letter for this option, but "-c" was already taken for "command source", so I used -C for "command source".

Maybe it's not too late to change the short letter for command script import, or we could add C as an alias?

lldb/source/Commands/CommandObjectCommands.cpp
156

Seems easy enough to detect, so why not?

jingham updated this revision to Diff 376083.Sep 29 2021, 5:57 PM

Made -C with an absolute path an error, added at test for it.

This revision is now accepted and ready to land.Sep 29 2021, 6:47 PM