Skip to content

Commit ea83d7c

Browse files
committed
Add new CLI arg to use any api url
1 parent e900281 commit ea83d7c

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/anonfile/__init__.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ def build_parser(package_name: str, version: str) -> ArgumentParser:
3333
parser.add_argument('--no-verbose', dest='verbose', action='store_false', help="run commands silently")
3434
parser.add_argument('-l', '--logging', default=True, action='store_true', help="enable URL logging (default)")
3535
parser.add_argument('--no-logging', dest='logging', action='store_false', help="disable all logging activities")
36+
parser.add_argument('-a', '--api', type=str, default=None, help="configure API endpoint (optional)")
3637
parser.add_argument('-t', '--token', type=str, default='secret', help="configure an API token (optional)")
3738
parser.add_argument('-a', '--user-agent', type=str, default=None, help="configure custom User-Agent (optional)")
3839
parser.add_argument('-p', '--proxies', type=str, default=None, help="configure HTTP and/or HTTPS proxies (optional)")
@@ -64,7 +65,11 @@ def main():
6465

6566
try:
6667
args = parser.parse_args()
67-
anon = AnonFile(args.token, user_agent=args.user_agent, proxies=format_proxies(args.proxies) if args.proxies else None)
68+
69+
anon = AnonFile(url=args.api,
70+
token=args.token,
71+
user_agent=args.user_agent,
72+
proxies=format_proxies(args.proxies) if args.proxies else None)
6873

6974
if args.command is None:
7075
raise UserWarning("missing a command")

0 commit comments

Comments
 (0)