diff --git a/httpie/cli/argparser.py b/httpie/cli/argparser.py index 4a817b81..835df376 100644 --- a/httpie/cli/argparser.py +++ b/httpie/cli/argparser.py @@ -78,7 +78,7 @@ class HTTPieArgumentParser(argparse.ArgumentParser): # Arguments processing and environment setup. self._apply_no_options(no_options) - self._validate_download_options() + self._process_download_options() self._setup_standard_streams() self._process_output_options() self._process_pretty_options() @@ -379,7 +379,11 @@ class HTTPieArgumentParser(argparse.ArgumentParser): # noinspection PyTypeChecker self.args.prettify = PRETTY_MAP[self.args.prettify] - def _validate_download_options(self): + def _process_download_options(self): + if self.args.offline: + self.args.download = False + self.args.download_resume = False + return if not self.args.download: if self.args.download_resume: self.error('--continue only works with --download') diff --git a/tests/test_httpie.py b/tests/test_httpie.py index 959287c9..48af0757 100644 --- a/tests/test_httpie.py +++ b/tests/test_httpie.py @@ -187,9 +187,8 @@ def test_offline(): r = http( '--offline', 'https://this-should.never-resolve/foo', - 'param==value' ) - assert 'GET /foo?param=value' in r + assert 'GET /foo' in r def test_offline_download(): @@ -198,6 +197,5 @@ def test_offline_download(): '--offline', '--download', 'https://this-should.never-resolve/foo', - 'param==value' ) - assert 'GET /foo?param=value' in r + assert 'GET /foo' in r