Пример #1
0
    help="Custom instance of LazySettings",
)
@click.pass_context
def main(ctx, instance):
    """Dynaconf - Command Line Interface\n
    Documentation: http://dynaconf.readthedocs.io/
    """
    set_settings(ctx, instance)


@main.command()
@click.option("--format",
              "fileformat",
              "-f",
              default="toml",
              type=click.Choice(EXTS))
@click.option("--path",
              "-p",
              default=CWD,
              help="defaults to current directory")
@click.option("--env",
              "-e",
              default=None,
              help="Sets the working env in `.env` file")
@click.option(
    "--vars",
    "_vars",
    "-v",
    multiple=True,
    default=None,
    help=("extra values to write to settings file "
Пример #2
0
    "-i",
    default=None,
    envvar="INSTANCE_FOR_DYNACONF",
    help="Custom instance of LazySettings",
)
@click.pass_context
def main(ctx, instance):
    """Dynaconf - Command Line Interface\n
    Documentation: https://dynaconf.com/
    """
    set_settings(ctx, instance)


@main.command()
@click.option(
    "--format", "fileformat", "-f", default="toml", type=click.Choice(EXTS)
)
@click.option(
    "--path", "-p", default=CWD, help="defaults to current directory"
)
@click.option(
    "--env", "-e", default=None, help="Sets the working env in `.env` file"
)
@click.option(
    "--vars",
    "_vars",
    "-v",
    multiple=True,
    default=None,
    help=(
        "extra values to write to settings file "
Пример #3
0
    sys.exit(1)

from .compat import IS_TYPE_CHECKING, to_env
from .main import dotenv_values, get_key, set_key, unset_key
from .version import __version__

if IS_TYPE_CHECKING:
    from typing import Any, List, Dict


@click.group()
@click.option('-f', '--file', default=os.path.join(os.getcwd(), '.env'),
              type=click.Path(exists=True),
              help="Location of the .env file, defaults to .env file in current working directory.")
@click.option('-q', '--quote', default='always',
              type=click.Choice(['always', 'never', 'auto']),
              help="Whether to quote or not the variable values. Default mode is always. This does not affect parsing.")
@click.version_option(version=__version__)
@click.pass_context
def cli(ctx, file, quote):
    # type: (click.Context, Any, Any) -> None
    '''This script is used to set, get or unset values from a .env file.'''
    ctx.obj = {}
    ctx.obj['FILE'] = file
    ctx.obj['QUOTE'] = quote


@cli.command()
@click.pass_context
def list(ctx):
    # type: (click.Context) -> None
Пример #4
0

@click.group()
@click.option(
    '-f',
    '--file',
    default=os.path.join(os.getcwd(), '.env'),
    type=click.Path(exists=_A),
    help=
    'Location of the .env file, defaults to .env file in current working directory.'
)
@click.option(
    '-q',
    '--quote',
    default=_F,
    type=click.Choice([_F, 'never', 'auto']),
    help=
    'Whether to quote or not the variable values. Default mode is always. This does not affect parsing.'
)
@click.version_option(version=__version__)
@click.pass_context
def cli(ctx, file, quote):
    A = ctx
    A.obj = {}
    A.obj[_B] = file
    A.obj[_C] = quote


@cli.command()
@click.pass_context
def list(ctx):