def add_parser(subparser, formatter_class):
    parser = subparser.add_parser('sat', help='Retrieve Satellite Scenes', formatter_class=formatter_class)
    parser.add_argument('--config', type=str, help='path to config file [required]')
    parser.add_argument('--pg', type=str, help='If set, override config PostgreSQL dsn.')
    extent = parser.add_argument_group('Spatial extent [one among the following is required]')
    extent.add_argument('--cover', type=str, help='path to csv tiles cover file')
    extent.add_argument('--granules', type=str, nargs='+', help='Military Grid Granules, (e.g 31TFL)')
    extent.add_argument('--scenes', type=str, help='Path to a Scenes UUID file')
    filters = parser.add_argument_group('Filters')
    filters.add_argument('--level', type=str, choices=['2A', '3A'], help='Processing Level')
    filters.add_argument('--start', type=str, help='YYYY-MM-DD starting date')
    filters.add_argument('--end', type=str, help='YYYY-MM-DD end date')
    filters.add_argument('--clouds', type=int, help='max threshold for cloud coverage [0-100]')
    filters.add_argument('--limit', type=int, default=500, help='max number of results per granule')
    dl = parser.add_argument_group('Download')
    dl.add_argument('--download', action='store_true', help='if set, perform also download operation.')
    dl.add_argument('--workers', type=int, default=4, help='number of workers [default: 4]')
    dl.add_argument('--timeout', type=int, default=180, help='download request timeout (in seconds) [default: 180]')
    parser.add_argument('--out', type=str, nargs='?', help='output directory path [required if download is set]')
    parser.set_defaults(func=main)
def add_parser(subparser, formatter_class):
    parser = subparser.add_parser('sat', help='Retrieve Satellite Scenes', formatter_class=formatter_class)
    parser.add_argument('--config', type=str, help='path to config file [required]')
    parser.add_argument('--pg', type=str, help='If set, override config PostgreSQL dsn.')
    extent = parser.add_argument_group('Spatial extent [one among the following is required]')
    extent.add_argument('--cover', type=str, help='path to csv tiles cover file')
    extent.add_argument('--granules', type=str, nargs='+', help='Military Grid Granules, (e.g 31TFL)')
    extent.add_argument('--scenes', type=str, help='Path to a Scenes UUID file')
    filters = parser.add_argument_group('Filters')
    filters.add_argument('--level', type=str, choices=['2A', '3A'], help='Processing Level')
    filters.add_argument('--start', type=str, help='YYYY-MM-DD starting date')
    filters.add_argument('--end', type=str, help='YYYY-MM-DD end date')
    filters.add_argument('--clouds', type=int, help='max threshold for cloud coverage [0-100]')
    filters.add_argument('--limit', type=int, default=500, help='max number of results per granule')
    dl = parser.add_argument_group('Download')
    dl.add_argument('--download', action='store_true', help='if set, perform also download operation.')
    dl.add_argument('--workers', type=int, default=4, help='number of workers [default: 4]')
    dl.add_argument('--timeout', type=int, default=180, help='download request timeout (in seconds) [default: 180]')
    parser.add_argument('--out', type=str, nargs='?', help='output directory path [required if download is set]')
    parser.set_defaults(func=main)