#!/usr/bin/python3

import sys
import argparse
from SystemLib import ogHelp
from DiskLib import ogCreatePartitions

if 2 == len (sys.argv) and 'help' == sys.argv[1]:
    #parser.print_help() sale en inglés aunque la locale indique otra cosa
    ogHelp ('ogCreatePartitions', 'ogCreatePartitions int_ndisk str_parttype:int_partsize ...', ['ogCreatePartitions 1 NTFS:10000000 EXT3:5000000 LINUX-SWAP:1000000'])
    sys.exit (0)

parser = argparse.ArgumentParser (add_help=False)
parser.add_argument ('disk')
parser.add_argument ('parts', nargs='+')
args = parser.parse_args()

ret = ogCreatePartitions (args.disk, args.parts)

if ret is not None:
    if   ret == True: sys.exit (0)
    elif ret == False: sys.exit (1)
    else: print (ret)
