Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(ardl.cli): Implement --version as standard cli #64

Merged
merged 1 commit into from
Oct 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ Usage: ardl [OPTIONS] COMMAND [ARGS]...
Arista Network Download CLI

Options:
--version Show the version and exit.
--token TEXT Arista Token from your customer account [env var:
ARISTA_TOKEN]
--help Show this message and exit.

Commands:
debug Debug commands to work with ardl
get Download Arista from Arista website
version Display version of ardl
```

> **Warning**
Expand Down Expand Up @@ -173,7 +173,7 @@ tqdm

On EVE-NG, you may have to install/upgrade __pyOpenSSL__ in version `23.0.0`:

```
```bash
# Error when running ardl: AttributeError: module 'lib' has no attribute 'X509_V_FLAG_CB_ISSUER_CHECK'

$ pip install pyopenssl --upgrade
Expand Down
12 changes: 2 additions & 10 deletions eos_downloader/cli/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
"""

import click
from rich.console import Console

import eos_downloader
from eos_downloader import __version__
from eos_downloader.cli.debug import commands as debug_commands
from eos_downloader.cli.get import commands as get_commands
from eos_downloader.cli.info import commands as info_commands
Expand All @@ -22,6 +21,7 @@


@click.group(cls=AliasedGroup)
@click.version_option(__version__)
@click.pass_context
@click.option(
"--token",
Expand All @@ -35,13 +35,6 @@ def ardl(ctx: click.Context, token: str) -> None:
ctx.obj["token"] = token


@click.command()
def version() -> None:
"""Display version of ardl"""
console = Console()
console.print(f"ardl is running version {eos_downloader.__version__}")


@ardl.group(cls=AliasedGroup, no_args_is_help=True)
@click.pass_context
def get(ctx: click.Context, cls: click.Group = AliasedGroup) -> None:
Expand Down Expand Up @@ -73,7 +66,6 @@ def cli() -> None:
get.add_command(get_commands.cvp)
info.add_command(info_commands.eos_versions)
debug.add_command(debug_commands.xml)
ardl.add_command(version)
# Load CLI
ardl(obj={}, auto_envvar_prefix="arista")

Expand Down