Skip to content

Commit

Permalink
Adds print version command
Browse files Browse the repository at this point in the history
  • Loading branch information
bandaangosta committed Jun 11, 2021
1 parent 83e0f03 commit 89d56d1
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion nmapper/__main__.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
from pprint import pprint
import typer
from nmapper import nmapper
from nmapper import __version__
from typing import Optional

# Command-line application commands and subcommands based in Typer
Expand Down Expand Up @@ -50,6 +51,10 @@ def hosts(attempts: Optional[int] = typer.Argument(None), base_ip: Optional[str]
if 'removed_hosts' in hosts:
print('\n'.join(hosts['removed_hosts']))

@app.command(short_help='Show current version')
def version():
print(__version__)

@config_app.command("list", short_help='List application settings')
def print_config():
nm = nmapper.Nmapper()
Expand Down Expand Up @@ -88,4 +93,4 @@ def main():
app()

if __name__ == "__main__":
main()
main()

0 comments on commit 89d56d1

Please sign in to comment.