2020-08-29 18:44:55 +02:00
|
|
|
#!/usr/bin/env python3
|
2020-08-30 14:59:07 +02:00
|
|
|
import argparse
|
2020-08-29 18:44:55 +02:00
|
|
|
import banana
|
|
|
|
|
|
|
|
if __name__ == "__main__":
|
2020-08-30 14:59:07 +02:00
|
|
|
parser = argparse.ArgumentParser(description="Convert dec number to banana")
|
2020-08-31 18:28:53 +02:00
|
|
|
parser.add_argument("num", help="Number to be converted", type=int)
|
2020-10-01 17:41:34 +02:00
|
|
|
parser.add_argument("--alphastart", help="Set starting alphabet", type=int)
|
|
|
|
parser.add_argument("--shiftend", help="Set shift for ending alphabet", type=int)
|
2020-08-31 18:21:24 +02:00
|
|
|
parser.add_argument("--minlength", help="Set minimum length", type=int)
|
2020-10-01 17:41:34 +02:00
|
|
|
parser.add_argument("--alphabet", help="Set alphabet")
|
2020-08-30 14:59:07 +02:00
|
|
|
args = parser.parse_args()
|
|
|
|
|
2020-10-01 17:41:34 +02:00
|
|
|
alphabet = None
|
|
|
|
if not args.alphabet is None:
|
|
|
|
alphabet = [list(i) for i in args.alphabet.split(",")]
|
|
|
|
|
|
|
|
print(banana.dec2banana(args.num, args.alphastart, args.shiftend, args.minlength, alphabet))
|
|
|
|
|