Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Updated argparse type definitions #58

Merged
merged 2 commits into from
Aug 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions types/argparse/argparse.d.tl
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,10 @@ local record argparse

add_help: function(self: Parser, boolean)

help_max_width: function(self: Parser, number): Parser
add_help_command: function(self: Parser, string | {string: any}): Parser
add_complete_command: function(self: Parser, string | {string: any}): Parser

-- TODO: should be Argument | Option
mutex: function(self: Parser, ...: any)

Expand Down Expand Up @@ -74,6 +78,12 @@ local record argparse
args: function(self: Option, args: string|integer): Option

action: function(self: Option, cb: ActionCallback)

hidden_name: function(self: Option, string)

hidden: function(self: Option, boolean)

convert: function(self: Option, function)
end

record Command
Expand All @@ -85,6 +95,8 @@ local record argparse
option: function(self: Command, name: string, description: string): Option

flag: function(self: Command, string, string): Option

handle_options: function(self: Command, boolean): Command
end

metamethod __call: function(self: argparse, name: string, description: string, epilog: string): Parser
Expand Down