From 36ff7ccfd7cd889cb843b7dbaf870b1ccffbead3 Mon Sep 17 00:00:00 2001 From: Martin Krung Date: Thu, 15 Aug 2024 19:31:57 +0200 Subject: [PATCH] docs: update cli example code (#2220) Co-authored-by: El De-dog-lo <3859395+fubuloubu@users.noreply.github.com> --- docs/userguides/clis.md | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/docs/userguides/clis.md b/docs/userguides/clis.md index 396aea054a..87fd191ea3 100644 --- a/docs/userguides/clis.md +++ b/docs/userguides/clis.md @@ -105,17 +105,21 @@ Additionally, specify `ecosystem`, `network`, or `provider` in your command func import click from ape.cli import ConnectedProviderCommand -@click.command(cls=ConnectedProviderCommand) -def cmd(network, provider): +@click.group() +def cli(): + pass + + @cli.command(cls=ConnectedProviderCommand) +def cmd_1(network, provider): click.echo(network.name) click.echo(provider.is_connected) # True -@click.command(cls=ConnectedProviderCommand) -def cmd(provider): + @cli.command(cls=ConnectedProviderCommand) +def cmd_2(provider): click.echo(provider.is_connected) # True -@click.command(cls=ConnectedProviderCommand) -def cmd(): + @cli.command(cls=ConnectedProviderCommand) +def cmd_3(): click.echo("Using params from ConnectedProviderCommand is optional") ```