def setup_parser()

in lib/ramble/spack/cmd/bootstrap.py [0:0]


def setup_parser(subparser):
    sp = subparser.add_subparsers(dest='subcommand')

    status = sp.add_parser('status', help='get the status of Spack')
    status.add_argument(
        '--optional', action='store_true', default=False,
        help='show the status of rarely used optional dependencies'
    )
    status.add_argument(
        '--dev', action='store_true', default=False,
        help='show the status of dependencies needed to develop Spack'
    )

    enable = sp.add_parser('enable', help='enable bootstrapping')
    _add_scope_option(enable)

    disable = sp.add_parser('disable', help='disable bootstrapping')
    _add_scope_option(disable)

    reset = sp.add_parser(
        'reset', help='reset bootstrapping configuration to Spack defaults'
    )
    spack.cmd.common.arguments.add_common_arguments(
        reset, ['yes_to_all']
    )

    root = sp.add_parser(
        'root', help='get/set the root bootstrap directory'
    )
    _add_scope_option(root)
    root.add_argument(
        'path', nargs='?', default=None,
        help='set the bootstrap directory to this value'
    )

    list = sp.add_parser(
        'list', help='list all the sources of software to bootstrap Spack'
    )
    _add_scope_option(list)

    trust = sp.add_parser(
        'trust', help='trust a bootstrapping source'
    )
    _add_scope_option(trust)
    trust.add_argument(
        'name', help='name of the source to be trusted'
    )

    untrust = sp.add_parser(
        'untrust', help='untrust a bootstrapping source'
    )
    _add_scope_option(untrust)
    untrust.add_argument(
        'name', help='name of the source to be untrusted'
    )

    add = sp.add_parser(
        'add', help='add a new source for bootstrapping'
    )
    _add_scope_option(add)
    add.add_argument(
        '--trust', action='store_true',
        help='trust the source immediately upon addition')
    add.add_argument(
        'name', help='name of the new source of software'
    )
    add.add_argument(
        'metadata_dir', help='directory where to find metadata files'
    )

    remove = sp.add_parser(
        'remove', help='remove a bootstrapping source'
    )
    remove.add_argument(
        'name', help='name of the source to be removed'
    )

    mirror = sp.add_parser(
        'mirror', help='create a local mirror to bootstrap Spack'
    )
    mirror.add_argument(
        '--binary-packages', action='store_true',
        help='download public binaries in the mirror'
    )
    mirror.add_argument(
        '--dev', action='store_true',
        help='download dev dependencies too'
    )
    mirror.add_argument(
        metavar='DIRECTORY', dest='root_dir',
        help='root directory in which to create the mirror and metadata'
    )