getpelican/pelican

`--extra-settings` option in CLI conflict with site source path parameter

kdeldycke opened this issue · 0 comments

Issue

The following CLI invokation works as expected:

$ pelican --extra-settings SITEURL='"https://kevin.deldycke.com"' --verbose ./content
(...)

But swapping the --extra-settings and --verbose option make the CLI fail:

$ pelican --verbose --extra-settings SITEURL='"https://kevin.deldycke.com"' ./content
Traceback (most recent call last):
  File "/home/runner/work/kevin-deldycke-blog/kevin-deldycke-blog/.venv/lib/python3.12/site-packages/pelican/__init__.py", line 290, in __call__
    k, v = item.split("=", 1)
    ^^^^
ValueError: not enough values to unpack (expected 2, got 1)

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/runner/work/kevin-deldycke-blog/kevin-deldycke-blog/.venv/bin/pelican", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/home/runner/work/kevin-deldycke-blog/kevin-deldycke-blog/.venv/lib/python3.12/site-packages/pelican/__init__.py", line 618, in main
    args = parse_arguments(argv)
           ^^^^^^^^^^^^^^^^^^^^^
  File "/home/runner/work/kevin-deldycke-blog/kevin-deldycke-blog/.venv/lib/python3.12/site-packages/pelican/__init__.py", line 495, in parse_arguments
    args = parser.parse_args(argv)
           ^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/argparse.py", line 1896, in parse_args
    args, argv = self.parse_known_args(args, namespace)
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/argparse.py", line 1929, in parse_known_args
    namespace, args = self._parse_known_args(args, namespace)
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/argparse.py", line 2150, in _parse_known_args
    start_index = consume_optional(start_index)
                  ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/argparse.py", line 2090, in consume_optional
    take_action(action, args, option_string)
  File "/opt/hostedtoolcache/Python/3.12.4/x64/lib/python3.12/argparse.py", line 2005, in take_action
    action(self, namespace, argument_values, option_string)
  File "/home/runner/work/kevin-deldycke-blog/kevin-deldycke-blog/.venv/lib/python3.12/site-packages/pelican/__init__.py", line 292, in __call__
    raise ValueError(
ValueError: Extra settings must be specified as KEY=VALUE pairs but you specified ./content