Update
This commit is contained in:
parent
36d6a2a87b
commit
c2b90f23d7
|
@ -24,3 +24,9 @@ repos:
|
|||
- id: isort
|
||||
name: Import order
|
||||
args: ["--profile=black", "./oxo"]
|
||||
- repo: https://github.com/PyCQA/autoflake
|
||||
rev: v1.4
|
||||
hooks:
|
||||
- id: autoflake
|
||||
name: Import pruning
|
||||
args: ["-i", "-r","--remove-unused-variables","--ignore-init-module-imports"]
|
||||
|
|
|
@ -1,7 +1,6 @@
|
|||
import typing as t
|
||||
from pathlib import Path
|
||||
|
||||
import httpx
|
||||
import typer
|
||||
|
||||
from oxo import __version__, api
|
||||
|
@ -29,7 +28,8 @@ def main(
|
|||
):
|
||||
"""A command line utility for 0x0.st compliant pastebins.
|
||||
|
||||
To use a different 0x0 site, set `OXO_BASE_URL` in your environment.
|
||||
To use a different 0x0 site, set `OXO_BASE_URL` in your environment,
|
||||
or specify it in the relevant subcommand.
|
||||
"""
|
||||
|
||||
|
||||
|
@ -45,13 +45,13 @@ def files(
|
|||
|
||||
|
||||
@app.command()
|
||||
def repost(urls: t.List[str], base_url=BASE_URL):
|
||||
def repost(urls: t.List[str] = typer.Argument(..., min=1), base_url=BASE_URL):
|
||||
"""Repost one or more urls."""
|
||||
typer.echo(api.repost(base_url, urls))
|
||||
|
||||
|
||||
@app.command()
|
||||
def shorten(urls: t.List[str], base_url=BASE_URL):
|
||||
def shorten(urls: t.List[str] = typer.Argument(..., min=1), base_url=BASE_URL):
|
||||
"""Shorten one or more urls."""
|
||||
if base_url == BASE_URL.default:
|
||||
typer.secho(
|
||||
|
|
Loading…
Reference in New Issue