title: Click - Dynamic Defaults for Prompts based on other options
body: <p>I'm using <a href="http://click.pocoo.org" rel="nofollow noreferrer">Click</a> to build a CLI interface. Click offers <a href="http://click.pocoo.org/6/options/#dynamic-defaults-for-prompts" rel="nofollow noreferrer">dynamic defaults for prompts</a>, which is great. Also <a href="https://stackoverflow.com/a/45870325/7311767">this example</a> gives some insights on how to implement dynamic defaults using a custom click-class and thus provide more flexible options when evaluating the default value.</p>
  
  <p>What I'm trying to do now is to have dynamic defaults based on another provided click option, e.g.</p>
  
  <pre><code>python mymodule --param1 something --param2 somethingelse
  </code></pre>
  
  <p>Now if <code>param2</code> is empty I want to try to get a dynamic default based on the provided <code>param1</code> input, e.g.:</p>
  
  <pre><code>@click.command()
  @click.option('--param1', prompt=True)
  @click.option('--param2', prompt=True, default=lambda: myfunct(param1))
  def cmd(param1, param2):
      pass
  
  myfunct(param1:str=None):
      param2 = None
      #get param2 based on param1 input
      return param2
  </code></pre>
  
  <p>Any ideas on what would be the best way to get that done?
  And is it guaranteed that <code>param1</code> is evaluated (and prompted for) before <code>param2</code>?</p>