title: Idiomatic rust way to properly parse Clap ArgMatches
body: <p>I'm learning rust and trying to make a find like utility (yes another one), im using clap and trying to support command line and config file for the program's parameters(this has nothing to do with the clap yml file).</p>
  
  <p>Im trying to parse the commands and if no commands were passed to the app, i will try to load them from a config file.
  Now I don't know how to do this in an idiomatic way.</p>
  
  <pre class="lang-rust prettyprint-override"><code>fn main() {
      let matches = App::new("findx")
          .version(crate_version!())
          .author(crate_authors!())
          .about("find + directory operations utility")
          .arg(
              Arg::with_name("paths")
                 ...
          )
          .arg(
              Arg::with_name("patterns")
                ...
          )
          .arg(
              Arg::with_name("operation")
              ...
          )
          .get_matches();
      let paths;
      let patterns;
      let operation;
      if matches.is_present("patterns") &amp;&amp; matches.is_present("operation") {
          patterns = matches.values_of("patterns").unwrap().collect();
          paths = matches.values_of("paths").unwrap_or(clap::Values&lt;&amp;str&gt;{"./"}).collect(); // this doesn't work
          operation = match matches.value_of("operation").unwrap() { // I dont like this
              "Append" =&gt; Operation::Append,
              "Prepend" =&gt; Operation::Prepend,
              "Rename" =&gt; Operation::Rename,
              _ =&gt; {
                  print!("Operation unsupported");
                  process::exit(1);
              }
          };
      }else if Path::new("findx.yml").is_file(){
          //TODO: try load from config file
      }else{
          eprintln!("Command line parameters or findx.yml file must be provided");
          process::exit(1);
      }
  
  
      if let Err(e) = findx::run(Config {
          paths: paths,
          patterns: patterns,
          operation: operation,
      }) {
          eprintln!("Application error: {}", e);
          process::exit(1);
      }
  }
  </code></pre>
  
  <p>There is an idiomatic way to extract <code>Option</code> and <code>Result</code> types values to the same scope, i mean all examples that i have read, uses <code>match</code> or <code>if let Some(x)</code> to consume the <code>x</code> value inside the scope of the pattern matching, but I need to assign the value to a variable.</p>
  
  <p>Can someone help me with this, or point me to the right direction?</p>
  
  <p>Best Regards </p>