diff options
Diffstat (limited to 'src/cli/ipconverter.py')
-rwxr-xr-x | src/cli/ipconverter.py | 25 |
1 files changed, 0 insertions, 25 deletions
diff --git a/src/cli/ipconverter.py b/src/cli/ipconverter.py deleted file mode 100755 index 4e6906b..0000000 --- a/src/cli/ipconverter.py +++ /dev/null @@ -1,25 +0,0 @@ -#!/usr/bin/env python3 - -""" -Utility to convert an IPv4 address to an int, or an int to an IPv4 address. -""" - -import ipaddress - -import click - - -@click.command() -@click.argument("ips", nargs=-1, type=int) -def int2ip(ips): - for ip in ips: - convip = ipaddress.ip_address(ip) - print(f"{ip} → {convip}") - - -@click.command() -@click.argument("ips", nargs=-1, type=str) -def ip2int(ips): - for ip in ips: - convip = int(ipaddress.ip_address(ip)) - print(f"{ip} → {convip}") |