#!/usr/bin/python3

import sys
import argparse
from SystemLib import ogHelp
from DiskLib import ogDiskToDev

parser = argparse.ArgumentParser (add_help=False)
parser.add_argument ('arg_disk', nargs='?', default=None)
parser.add_argument ('arg_part', nargs='?', default=None)

if 2 == len (sys.argv) and 'help' == sys.argv[1]:
    #parser.print_help() sale en inglés aunque la locale indique otra cosa
    ogHelp ('ogDiskToDev', 'ogDiskToDev int_ndisk [int_npartition]', ['ogDiskToDev', 'ogDiskToDev 1', 'ogDiskToDev 1 1'])
    sys.exit (0)

args = parser.parse_args()

ret = ogDiskToDev (args.arg_disk, args.arg_part)
if ret is not None:
    if   ret == True: sys.exit (0)
    elif ret == False: sys.exit (1)
    else: print (ret)
