#!/usr/bin/python3

import sys
import argparse
from SystemLib import ogHelp
from BootLib import ogWindowsRegisterPartition

parser = argparse.ArgumentParser (add_help=False)
parser.add_argument ('registered_disk')
parser.add_argument ('registered_par')
parser.add_argument ('registered_vol')
parser.add_argument ('disk')
parser.add_argument ('par')

if 2 == len (sys.argv) and 'help' == sys.argv[1]:
    #parser.print_help() sale en inglés aunque la locale indique otra cosa
    ogHelp ('ogWindowsRegisterPartition', 'ogWindowsRegisterPartition int_ndisk_TO_register int_partition_TO_register str_NewVolume int_disk int_partition', ['ogWindowsRegisterPartition 1 1 c: 1 1'])
    sys.exit (0)

args = parser.parse_args()

ret = ogWindowsRegisterPartition (args.registered_disk, args.registered_par, args.registered_vol, args.disk, args.par)
if ret is not None:
    if   ret == True: sys.exit (0)
    elif ret == False: sys.exit (1)
    else: print (ret)
