MCPcopy
hub / github.com/Kaggle/kaggle-cli / parse_auth

Function parse_auth

src/kaggle/cli.py:1739–1782  ·  view source on GitHub ↗
(subparsers)

Source from the content-addressed store, hash-verified

1737
1738
1739def parse_auth(subparsers) -> None:
1740 parser_auth = subparsers.add_parser("auth", formatter_class=argparse.RawTextHelpFormatter, help=Help.group_auth)
1741 subparsers_auth = parser_auth.add_subparsers(title="commands", dest="command")
1742 subparsers_auth.required = True
1743 subparsers_auth.choices = Help.auth_choices
1744
1745 parser_auth_login = subparsers_auth.add_parser(
1746 "login", formatter_class=argparse.RawTextHelpFormatter, help=Help.command_auth_login
1747 )
1748 parser_auth_login.add_argument(
1749 "--no-launch-browser",
1750 dest="no_launch_browser",
1751 action="store_true",
1752 help="Do not launch a browser for authentication",
1753 )
1754 parser_auth_login.add_argument(
1755 "--force",
1756 dest="force",
1757 action="store_true",
1758 help="Re-run the login flow even if the current account is already logged-in",
1759 )
1760 parser_auth_login.set_defaults(func=api.auth_login_cli)
1761
1762 parser_auth_print_access_token = subparsers_auth.add_parser(
1763 "print-access-token", formatter_class=argparse.RawTextHelpFormatter, help=Help.command_auth_print_access_token
1764 )
1765 parser_auth_print_access_token.add_argument(
1766 "--expiration",
1767 dest="expiration_duration",
1768 required=False,
1769 help="Override the default expiration duration. Example: 6h for 6 hours, 2:30 for 2 hours and 30 minutes.",
1770 )
1771 parser_auth_print_access_token.set_defaults(func=api.auth_print_access_token)
1772
1773 parser_auth_revoke_token = subparsers_auth.add_parser(
1774 "revoke", formatter_class=argparse.RawTextHelpFormatter, help=Help.command_auth_revoke_token
1775 )
1776 parser_auth_revoke_token.add_argument(
1777 "--reason",
1778 dest="reason",
1779 required=False,
1780 help="Reason for revoking the token. If not specified, the default reason will be used.",
1781 )
1782 parser_auth_revoke_token.set_defaults(func=api.auth_revoke_token)
1783
1784
1785def parse_quota(subparsers) -> None:

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected