What's the best way to provide a default value for a function parameter?
For example, suppose I have a function like this:

function greet -a name language
  switch "$language"
    case 'english'
      echo 'Hello, '$name
    case 'spanish'
      echo 'Hola, '$name
    case '*'
      echo unsupported language $language
  end
end

If it is called with "greet Bob", I want language to default to 'english'.

-- 
R. Mark Volkmann
Object Computing, Inc.
------------------------------------------------------------------------------
Check out the vibrant tech community on one of the world's most
engaging tech sites, Slashdot.org! http://sdm.link/slashdot
_______________________________________________
Fish-users mailing list
Fish-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/fish-users

Reply via email to