title: click python how can i read json like argument from command line
body: <p>my issue is that I want to perform something similar to what <a href="https://httpie.org" rel="nofollow noreferrer">httpie</a> does. Example</p>
  
  <pre><code>cli foo:='["http","pie"]'
  </code></pre>
  
  <p>What I have done in my code is this</p>
  
  <pre><code>@click.command()
  @click.argument('options', nargs=1)
  def dummy(options):
      key, value = options.split(':=')
      click.echo({key: json.loads(value)})
  </code></pre>
  
  <p>For test, I have tried the following commands in my shell:</p>
  
  <p><code>$ ibc dummy star:="{"foo":"bar"}"</code> and
  <code>$ ibc dummy star:={"foo":"bar"}</code> (I have a Windows 10 machine)</p>
  
  <p>I get a <code>json.JSONDecodeError</code>. Can somebody helps me to debug this issue?</p>
  
  <p>The stack trace is the following:</p>
  
  <pre><code>Traceback (most recent call last):
  File "C:\Users\rolla\.virtualenvs\infoblox_client-tZbB1-ed\Scripts\ibc-script.py", line 11, in &lt;module&gt;
  load_entry_point('infoblox-client', 'console_scripts', 'ibc')()
  File "c:\users\rolla\.virtualenvs\infoblox_client-tzbb1-ed\lib\site-packages\click\core.py", line 764, in __call__
  return self.main(*args, **kwargs)
  File "c:\users\rolla\.virtualenvs\infoblox_client-tzbb1-ed\lib\site-packages\click\core.py", line 717, in main
  rv = self.invoke(ctx)
  File "c:\users\rolla\.virtualenvs\infoblox_client-tzbb1-ed\lib\site-packages\click\core.py", line 1137, in invoke
  return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "c:\users\rolla\.virtualenvs\infoblox_client-tzbb1-ed\lib\site-packages\click\core.py", line 956, in invoke
  return ctx.invoke(self.callback, **ctx.params)
  File "c:\users\rolla\.virtualenvs\infoblox_client-tzbb1-ed\lib\site-packages\click\core.py", line 555, in invoke
  return callback(*args, **kwargs)
  File "d:\projets\python\infoblox_client\infoblox\scripts\__init__.py", line 31, in dummy
  click.echo({key: json.loads(value)})
  File "C:\Users\rolla\AppData\Local\Programs\Python\Python37-32\Lib\json\__init__.py", line 348, in loads
  return _default_decoder.decode(s)
  File "C:\Users\rolla\AppData\Local\Programs\Python\Python37-32\Lib\json\decoder.py", line 337, in decode
  obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "C:\Users\rolla\AppData\Local\Programs\Python\Python37-32\Lib\json\decoder.py", line 353, in raw_decode
  obj, end = self.scan_once(s, idx)
  json.decoder.JSONDecodeError: Expecting property name enclosed in double quotes: line 1 column 2 (char 1)
  </code></pre>