Skip to content

Commit

Permalink
fix: now support uvx
Browse files Browse the repository at this point in the history
  • Loading branch information
HYP3R00T committed Nov 25, 2024
1 parent ca4c788 commit 0366fb0
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions omnishare/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,19 @@
from omnishare.token_handler import delete_token, prompt_token, save_token
from omnishare.utils import confirm

app = typer.Typer()


@app.command()
def main(
file: Annotated[str, typer.Argument(help="Provide markdown file")],
add_token: Annotated[bool | None, typer.Option(help="Add API token")] = False,
config: Annotated[bool | None, typer.Option(help="Add API token")] = False,
config: Annotated[bool | None, typer.Option(help="Configure the tool")] = False,
reset: Annotated[bool | None, typer.Option(help="Warning: Remove all saved tokens")] = False,
):
# Greeter
console: Console = Console()
console.clear()
# console.print("Welcome", style="yellow")

if add_token:
add_more: bool = True
Expand All @@ -30,7 +32,7 @@ def main(
"LinkedIn",
"Mastodon",
]
console.print("Select a platform (Use arrow keys)\n", style="Cyan")
console.print("Select a platform (Use arrow keys)\n", style="cyan")
option: str = select(sorted(options), cursor="\uf061", cursor_style="red")
if option in options:
token = prompt_token()
Expand All @@ -43,17 +45,14 @@ def main(
delete_token()

if config:
console.print("This is Work in Progress")
# TODO: Add handler
pass

post: Post = process_file(file)
# print(post.metadata)
# print(post.content)

# print(markdown_to_plain(post.content))
linkedin_post(markdown_to_plain(post.content))
mastodon_post(markdown_to_plain(post.content))


if __name__ == "__main__":
typer.run(main)
app()

0 comments on commit 0366fb0

Please sign in to comment.