feat: add enums to args (#45)

This commit is contained in:
Jeroen Op 't Eynde 2023-02-16 19:57:15 +01:00 committed by GitHub
parent 5e45c19fbe
commit cf4ff4b950
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
3 changed files with 61 additions and 8 deletions

View file

@ -203,9 +203,31 @@
for arg in self.doc.args
]),
enums: std.join('', [
if arg.enums != null
then '\n\nAccepted values for `%s` are ' % arg.name
+ (
std.join(', ', [
std.toString(item)
for item in arg.enums
])
)
else ''
for arg in self.doc.args
]),
linkName: '%(name)s(%(args)s)' % self,
content: '```ts\n%(name)s(%(args)s)\n```\n\n%(help)s' % self,
content:
(|||
```ts
%(name)s(%(args)s)
```
||| % self)
+ '%(help)s' % self
+ '%(enums)s' % self,
// odd concatenation to prevent unintential newline changes
},