Skip to content

Commit 7fae6bb

Browse files
committed
[swift-api-dump] Add options to tweak output.
Introduce a few new options to tweak the output of this script: -show-overlay Show overlay API in addition to Objective-C module API -show-doc-comments Show documentation comments -show-unavailable Show declarations that are unavailable in Swift As requested by rdar://problem/39384089.
1 parent 9accf4a commit 7fae6bb

File tree

1 file changed

+19
-3
lines changed

1 file changed

+19
-3
lines changed

utils/swift-api-dump.py

Lines changed: 19 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,13 @@ def create_parser():
104104
'member.')
105105
parser.add_argument('-swift-version', type=int, metavar='N',
106106
help='the Swift version to use')
107+
parser.add_argument('-show-overlay', action='store_true',
108+
help='Show overlay API in addition to Objective-C ' +
109+
'module API')
110+
parser.add_argument('-show-doc-comments', action='store_true',
111+
help='Show documentation comments')
112+
parser.add_argument('-show-unavailable', action='store_true',
113+
help='Show declarations that are unavailable in Swift')
107114
return parser
108115

109116

@@ -288,12 +295,21 @@ def main():
288295
'-print-module',
289296
'-source-filename',
290297
source_filename,
291-
'-module-print-skip-overlay',
292-
'-skip-unavailable',
293-
'-skip-print-doc-comments',
294298
'-skip-overrides'
295299
]
296300

301+
# Add -module-print-skip-overlay
302+
if not args.show_overlay:
303+
cmd_common += ['-module-print-skip-overlay']
304+
305+
# Add -skip-print-doc-comments
306+
if not args.show_doc_comments:
307+
cmd_common += ['-skip-print-doc-comments']
308+
309+
# Add -skip-unavailable
310+
if not args.show_unavailable:
311+
cmd_common += ['-skip-unavailable']
312+
297313
# Add -F / -iframework / -I arguments.
298314
if args.framework_dir:
299315
for path in args.framework_dir:

0 commit comments

Comments
 (0)