Re: [Fish-users] Error with -a combined test expression

2019-03-05 Thread Tassilo Horn
Glenn Jackman writes: > First, if the error message is "should be in an empty directory", then > why is a empty 2nd argument part of that test? Well, it is actually "should be empty unless the more than 1 argument is given", so what's in need of a fix is the error message. > I would test for em

Re: [Fish-users] Error with -a combined test expression

2019-03-05 Thread Glenn Jackman
First, if the error message is "should be in an empty directory", then why is a empty 2nd argument part of that test? That should probably be a separate test and separate error message. I would test for empty directory like: set files * .* if test (count $files) != 0; echo error; end And to tes

Re: [Fish-users] Error with -a combined test expression

2019-03-05 Thread David Adam
On Tue, 5 Mar 2019, Tassilo Horn wrote: > in a script, I have this code: > > --8<---cut here---start->8--- > if test \( (count (ls -A .)) != "0" \) -a \( -z $argv[2] \) > echo "This should be run in an empty directory." > exit 3 > end > --8<-

[Fish-users] Error with -a combined test expression

2019-03-05 Thread Tassilo Horn
Hi all, in a script, I have this code: --8<---cut here---start->8--- if test \( (count (ls -A .)) != "0" \) -a \( -z $argv[2] \) echo "This should be run in an empty directory." exit 3 end --8<---cut here---end--->8--