title: How to create Tcl Procedure with options?
body: <p>I want to create tcl procedures with some options. I know procedures with arguments and optional arguments, but don't know options. For example, if I am calling my procedure arith in following three ways (-add for addition, -sub for subtraction):</p>
  
  <pre><code>1) arith 10 5 
  2) arith -add 10 5   or   arith 10 5 -add
  3) arith -sub 10 5   or   arith 10 5 -sub
  </code></pre>
  
  <p>Respectively output should be 1) 15 (by default it should add), 2) 15,   3) 5</p>
  
  <p>How to write this procedure in Tcl? I am new to tcl, please suggest me some online material or book for Tcl.</p>