diff --git a/piptools/scripts/compile.py b/piptools/scripts/compile.py index 7faa08b03..9cf8e5b6f 100755 --- a/piptools/scripts/compile.py +++ b/piptools/scripts/compile.py @@ -46,8 +46,8 @@ class PipCommand(pip.basecommand.Command): help="Add header to generated file") @click.option('--index/--no-index', is_flag=True, default=True, help="Add index URL to generated file") -@click.option('--emit-trusted-host/--no-trusted-host', is_flag=True, default=True, - help="Add trusted host option to generated file") +@click.option('--emit-trusted-host/--no-emit-trusted-host', is_flag=True, + default=True, help="Add trusted host option to generated file") @click.option('--annotate/--no-annotate', is_flag=True, default=True, help="Annotate results, indicating where dependencies come from") @click.option('-U', '--upgrade', is_flag=True, default=False, diff --git a/piptools/writer.py b/piptools/writer.py index 0bcdebee7..ab391c74d 100644 --- a/piptools/writer.py +++ b/piptools/writer.py @@ -40,7 +40,7 @@ def write_header(self): if not self.emit_index: params += ['--no-index'] if not self.emit_trusted_host: - params += ['--no-trusted-host'] + params += ['--no-emit-trusted-host'] if not self.annotate: params += ['--no-annotate'] if self.generate_hashes: diff --git a/tests/test_cli.py b/tests/test_cli.py index 42bc9bbab..ffdd0a809 100644 --- a/tests/test_cli.py +++ b/tests/test_cli.py @@ -116,7 +116,7 @@ def test_trusted_host_no_emit(pip_conf): open('requirements.in', 'w').close() out = runner.invoke(cli, ['-v', '--trusted-host', 'example.com', - '--no-trusted-host']) + '--no-emit-trusted-host']) print(out.output) assert '--trusted-host example.com' not in out.output - assert '--no-trusted-host' in out.output + assert '--no-emit-trusted-host' in out.output