Skip to content

Commit

Permalink
Fix: Passing to arg did not show help
Browse files Browse the repository at this point in the history
Problem: Calling a command with no argument only displayed "Press --help for help".

Solution: Use a feature of Typer to display the help automatically when no argument is passed.
  • Loading branch information
hoh authored and MHHukiewitz committed Apr 29, 2024
1 parent ecb113a commit c293aff
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/aleph_client/__main__.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
program,
)

app = AsyncTyper()
app = AsyncTyper(no_args_is_help=True)

app.add_typer(account.app, name="account", help="Manage account")
app.add_typer(
Expand Down
2 changes: 1 addition & 1 deletion src/aleph_client/commands/about.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@

from aleph_client.utils import AsyncTyper

app = AsyncTyper()
app = AsyncTyper(no_args_is_help=True)


def get_version(value: bool):
Expand Down
2 changes: 1 addition & 1 deletion src/aleph_client/commands/account.py
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
from aleph_client.utils import AsyncTyper

logger = logging.getLogger(__name__)
app = AsyncTyper()
app = AsyncTyper(no_args_is_help=True)


@app.command()
Expand Down
2 changes: 1 addition & 1 deletion src/aleph_client/commands/aggregate.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
from aleph_client.commands.utils import setup_logging
from aleph_client.utils import AsyncTyper

app = AsyncTyper()
app = AsyncTyper(no_args_is_help=True)


@app.command()
Expand Down
2 changes: 1 addition & 1 deletion src/aleph_client/commands/domain.py
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
from aleph_client.commands.utils import is_environment_interactive
from aleph_client.utils import AsyncTyper

app = AsyncTyper()
app = AsyncTyper(no_args_is_help=True)


async def get_aggregate_domain_info(account, fqdn):
Expand Down
2 changes: 1 addition & 1 deletion src/aleph_client/commands/files.py
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
from aleph_client.utils import AsyncTyper

logger = logging.getLogger(__name__)
app = AsyncTyper()
app = AsyncTyper(no_args_is_help=True)


@app.command()
Expand Down
2 changes: 1 addition & 1 deletion src/aleph_client/commands/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
from aleph_client.utils import AsyncTyper

logger = logging.getLogger(__name__)
app = AsyncTyper()
app = AsyncTyper(no_args_is_help=True)


def load_ssh_pubkey(ssh_pubkey_file: Path) -> str:
Expand Down
2 changes: 1 addition & 1 deletion src/aleph_client/commands/message.py
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
from aleph_client.utils import AsyncTyper
from aleph_message.models import AlephMessage, ItemHash, MessageType, ProgramMessage

app = AsyncTyper()
app = AsyncTyper(no_args_is_help=True)


@app.command()
Expand Down
2 changes: 1 addition & 1 deletion src/aleph_client/commands/node.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
from aleph_client.utils import AsyncTyper

logger = logging.getLogger(__name__)
app = AsyncTyper()
app = AsyncTyper(no_args_is_help=True)

node_link = "https://api2.aleph.im/api/v0/aggregates/0xa1B3bb7d2332383D96b7796B908fB7f7F3c2Be10.json?keys=corechannel"

Expand Down
2 changes: 1 addition & 1 deletion src/aleph_client/commands/program.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
from aleph_message.status import MessageStatus

logger = logging.getLogger(__name__)
app = AsyncTyper()
app = AsyncTyper(no_args_is_help=True)


@app.command()
Expand Down

0 comments on commit c293aff

Please sign in to comment.