# Path: ssmlib/main.py
# def main(args=None):
# 
#     if args:
#         sys.argv = args.split()
# 
#     options = Options()
#     PR.set_options(options)
#     storage = StorageHandle(options)
#     ssm_parser = SsmParser(storage)
#     args = ssm_parser.parse()
# 
#     # Check create command dependency
#     if args.func == storage.create:
#         if not args.raid:
#             if (args.stripesize):
#                 err = "You can not specify --stripesize without specifying" + \
#                       " RAID level!"
#                 ssm_parser.parser_create.error(err)
#             if (args.stripes):
#                 err = "You can not specify --stripes without specifying" + \
#                       " RAID level!"
#                 ssm_parser.parser_create.error(err)
#         # This should be changed to be future proofed and every time we add
#         # new options to any of the commands it would need to be enabled
#         # in each backend if appropriate
#         if args.virtual_size and args.pool.type not in ["lvm", "thin"]:
#                 err = "Backed '{0}' does not".format(args.pool.type) + \
#                       " support --virtual-size option!"
#                 ssm_parser.parser_create.error(err)
# 
#     options.verbose = args.verbose
#     options.force = args.force
# 
#     if args.vv or args.vvv:
#         options.verbose = True
#         options.vv = True
# 
#     if args.vvv:
#         options.vvv = True
# 
# 
#     #storage.set_globals(args.force, args.verbose, args.yes, args.config)
#     storage.set_globals(options)
# 
#     # Register clean-up function on exit
#     atexit.register(misc.do_cleanup)
# 
#     if args.dry_run:
#         return 0
# 
#     try:
#         args.func(args)
#     except argparse.ArgumentTypeError as ex:
#         ssm_parser.parser.error(ex)
# 
#     return 0


import re
import sys, os
from ssmlib import main
SYNOPSIS_INC = "src/synopsis.inc"
OPTIONS_DIR = "src/options/"
SSM_OPTIONS_INC = OPTIONS_DIR + "ssm_options.inc"
CREATE_OPTIONS_INC = OPTIONS_DIR + "create_options.inc"
INFO_OPTIONS_INC = OPTIONS_DIR + "info_options.inc"
LIST_OPTIONS_INC = OPTIONS_DIR + "list_options.inc"
REMOVE_OPTIONS_INC = OPTIONS_DIR + "remove_options.inc"
RESIZE_OPTIONS_INC = OPTIONS_DIR + "resize_options.inc"
CHECK_OPTIONS_INC = OPTIONS_DIR + "check_options.inc"
SNAPSHOT_OPTIONS_INC = OPTIONS_DIR + "snapshot_options.inc"
ADD_OPTIONS_INC = OPTIONS_DIR + "add_options.inc"
MOUNT_OPTIONS_INC = OPTIONS_DIR + "mount_options.inc"
MIGRATE_OPTIONS_INC = OPTIONS_DIR + "migrate_options.inc"

SSM_USAGE_INC = OPTIONS_DIR + "ssm_usage.inc"
CREATE_USAGE_INC = OPTIONS_DIR + "create_usage.inc"
INFO_USAGE_INC = OPTIONS_DIR + "info_usage.inc"
LIST_USAGE_INC = OPTIONS_DIR + "list_usage.inc"
REMOVE_USAGE_INC = OPTIONS_DIR + "remove_usage.inc"
RESIZE_USAGE_INC = OPTIONS_DIR + "resize_usage.inc"
CHECK_USAGE_INC = OPTIONS_DIR + "check_usage.inc"
SNAPSHOT_USAGE_INC = OPTIONS_DIR + "snapshot_usage.inc"
ADD_USAGE_INC = OPTIONS_DIR + "add_usage.inc"
MOUNT_USAGE_INC = OPTIONS_DIR + "mount_usage.inc"
MIGRATE_USAGE_INC = OPTIONS_DIR + "migrate_usage.inc"


class GenerateIncludes(object):

    def __init__(self):

# Path: ssmlib/main.py
# def main(args=None):
# 
#     if args:
#         sys.argv = args.split()
# 
#     options = Options()
#     PR.set_options(options)
#     storage = StorageHandle(options)
#     ssm_parser = SsmParser(storage)
#     args = ssm_parser.parse()
# 
#     # Check create command dependency
#     if args.func == storage.create:
#         if not args.raid:
#             if (args.stripesize):
#                 err = "You can not specify --stripesize without specifying" + \
#                       " RAID level!"
#                 ssm_parser.parser_create.error(err)
#             if (args.stripes):
#                 err = "You can not specify --stripes without specifying" + \
#                       " RAID level!"
#                 ssm_parser.parser_create.error(err)
#         # This should be changed to be future proofed and every time we add
#         # new options to any of the commands it would need to be enabled
#         # in each backend if appropriate
#         if args.virtual_size and args.pool.type not in ["lvm", "thin"]:
#                 err = "Backed '{0}' does not".format(args.pool.type) + \
#                       " support --virtual-size option!"
#                 ssm_parser.parser_create.error(err)
# 
#     options.verbose = args.verbose
#     options.force = args.force
# 
#     if args.vv or args.vvv:
#         options.verbose = True
#         options.vv = True
# 
#     if args.vvv:
#         options.vvv = True
# 
# 
#     #storage.set_globals(args.force, args.verbose, args.yes, args.config)
#     storage.set_globals(options)
# 
#     # Register clean-up function on exit
#     atexit.register(misc.do_cleanup)
# 
#     if args.dry_run:
#         return 0
# 
#     try:
#         args.func(args)
#     except argparse.ArgumentTypeError as ex:
#         ssm_parser.parser.error(ex)
# 
#     return 0


# Path: doc/generate_usage_includes.py
import re
import sys, os
from ssmlib import main

SYNOPSIS_INC = "src/synopsis.inc"
OPTIONS_DIR = "src/options/"
SSM_OPTIONS_INC = OPTIONS_DIR + "ssm_options.inc"
CREATE_OPTIONS_INC = OPTIONS_DIR + "create_options.inc"
INFO_OPTIONS_INC = OPTIONS_DIR + "info_options.inc"
LIST_OPTIONS_INC = OPTIONS_DIR + "list_options.inc"
REMOVE_OPTIONS_INC = OPTIONS_DIR + "remove_options.inc"
RESIZE_OPTIONS_INC = OPTIONS_DIR + "resize_options.inc"
CHECK_OPTIONS_INC = OPTIONS_DIR + "check_options.inc"
SNAPSHOT_OPTIONS_INC = OPTIONS_DIR + "snapshot_options.inc"
ADD_OPTIONS_INC = OPTIONS_DIR + "add_options.inc"
MOUNT_OPTIONS_INC = OPTIONS_DIR + "mount_options.inc"
MIGRATE_OPTIONS_INC = OPTIONS_DIR + "migrate_options.inc"

SSM_USAGE_INC = OPTIONS_DIR + "ssm_usage.inc"
CREATE_USAGE_INC = OPTIONS_DIR + "create_usage.inc"
INFO_USAGE_INC = OPTIONS_DIR + "info_usage.inc"
LIST_USAGE_INC = OPTIONS_DIR + "list_usage.inc"
REMOVE_USAGE_INC = OPTIONS_DIR + "remove_usage.inc"
RESIZE_USAGE_INC = OPTIONS_DIR + "resize_usage.inc"
CHECK_USAGE_INC = OPTIONS_DIR + "check_usage.inc"
SNAPSHOT_USAGE_INC = OPTIONS_DIR + "snapshot_usage.inc"
ADD_USAGE_INC = OPTIONS_DIR + "add_usage.inc"
MOUNT_USAGE_INC = OPTIONS_DIR + "mount_usage.inc"
MIGRATE_USAGE_INC = OPTIONS_DIR + "migrate_usage.inc"


class GenerateIncludes(object):

    def __init__(self):

        self.storage = main.StorageHandle()