title: Fish shell script: add a list as a function's argument
body: <p>I would like to pass a list of variable length as a parameter into a fish function called and defined within a fish script, similar to how <code>$argv</code> is a list on the top level of a fish script I guess.</p>
  <pre><code>function main_function
     function f --argument xs
        echo &quot;called f&quot;
        echo $xs     
     end
      set xs &quot;one&quot; &quot;two&quot; &quot;three&quot;;
      f $xs
  end
  </code></pre>
  <p>calling <code>function --help</code> mentions the <code>--inherit-variable</code> option. While setting the option causes the <code>xs</code> variable within the f's scope to be the full list, it makes a dumb copy at the point where the function is defined. I need the variable to be copied when f is called, however.</p>
  <pre><code>function main_function
     set xs &quot;one&quot; &quot;two&quot; &quot;three&quot;;
     function f --inherit-variable xs
        echo &quot;called f&quot;
        echo $xs     
     end
     f $xs
  end
  </code></pre>