Skip to content

Commit

Permalink
hawkmoth: add option to dump cursor cache info
Browse files Browse the repository at this point in the history
This may be helpful in tuning the cache size.
  • Loading branch information
BrunoMSantos committed Nov 18, 2023
1 parent 4c578b5 commit ecc4321
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/hawkmoth/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
from hawkmoth.ext import napoleon
from hawkmoth.parser import parse
from hawkmoth.util import doccompat
from hawkmoth.doccursor import DocCursor

def filename(file):
if os.path.isfile(file):
Expand Down Expand Up @@ -76,6 +77,9 @@ def main():
help='Argument to pass to Clang. May be specified multiple times. See cautodoc_clang.') # noqa: E501
parser.add_argument('--verbose', dest='verbose', action='store_true',
help='Verbose output.')
parser.add_argument('--cursor-cache-info', dest='cursor_cache_info',
action='store_true',
help='Print cursor cache information.')
parser.add_argument('--version', action='version',
version=f'%(prog)s {_read_version()}',
help='Show version and exit')
Expand All @@ -97,5 +101,9 @@ def main():
for error in errors:
print(f'{error.level.name}: {error.get_message()}', file=sys.stderr)

if args.cursor_cache_info:
print('>>> Cursor cache info:')
print(DocCursor.cache_info())

if __name__ == '__main__':
main()

0 comments on commit ecc4321

Please sign in to comment.