On Fri, Aug 18, 2017 at 5:53 PM, Mark Volkmann
wrote:
> I was so close!
> I had this:
> set -q language; or set language 'english'
>
> Why do I need the [1] part?
>
Because fish vars can be set but have no value. Every fish var is an array
which can have zero, one, or
I was so close!
I had this:
set -q language; or set language 'english'
Why do I need the [1] part?
On Fri, Aug 18, 2017 at 5:51 PM, Kurtis Rader wrote:
> Add this to the top of the function:
>
> set -q language[1]
> or set language english
>
> On Fri, Aug 18, 2017 at 3:25
On Fri, Aug 18, 2017 at 4:12 PM, Greg Reagle wrote:
> On Fri, Aug 18, 2017, at 18:51, Kurtis Rader wrote:
> > Add this to the top of the function:
> >
> > set -q language[1]
> > or set language english
>
> There is a potential problem with the above though. If $language is
On Fri, Aug 18, 2017, at 18:51, Kurtis Rader wrote:
> Add this to the top of the function:
>
> set -q language[1]
> or set language english
There is a potential problem with the above though. If $language is set
to the empty string, the above code will not set language to english
[1]. I say
Yes, that verbiage is wrong. I suspect the final sentence was intended to
be this:
In fish you would type **/*.fish to match files ending in ".fish" in
subdirs but not the PWD. If you want to include files in the PWD as well as
subdirs just type **.fish.
On Fri, Aug 18, 2017 at 3:44 PM, Mark
Should have replied to list.
- Original message -
From: Greg Reagle
To: Mark Volkmann
Subject: Re: [Fish-users] default function parameters
Date: Fri, 18 Aug 2017 18:43:28 -0400
On Fri, Aug 18, 2017, at 18:25, Mark Volkmann wrote:
>
Should go to list. Sorry for replying wrong earlier.
- Original message -
From: Mark Volkmann
To: Greg Reagle
Subject: Re: [Fish-users] default function parameters
Date: Fri, 18 Aug 2017 17:46:42 -0500
But suppose I wasn't using a
Add this to the top of the function:
set -q language[1]
or set language english
On Fri, Aug 18, 2017 at 3:25 PM, Mark Volkmann
wrote:
> What's the best way to provide a default value for a function parameter?
> For example, suppose I have a function like this:
>
>
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