title: Bash alias and bash function with several arguments
body: <p>I want to use both bash alias and bash function with several arguments. I emulate svn sub commands.</p>
  
  <pre><code>$ svngrep -nr 'Foo' .
  $ svn grep -nr 'Foo' .
  </code></pre>
  
  <p>My expectation is both act as below:</p>
  
  <pre><code>grep --exclude='*.svn-*' --exclude='entries' -nr 'Foo' .
  </code></pre>
  
  <p>But actual, only alias ('svngrep') does well, function ('svn grep') causes invalid option error. How to write my .bashrc?</p>
  
  <pre><code>#~/.bashrc
  
  alias svngrep="grep --exclude='*.svn-*' --exclude='entries'"
  
  svn() {
    if [[ $1 == grep ]]
  then
    local remains=$(echo $@ | sed -e 's/grep//')
    command "$svngrep $remains"
  else
    command svn "$@"
  fi
  }
  </code></pre>