14 Apr 2021 |
faho (Fabian Homborg) | Oh, and function explains that it's --current-function . | 19:44:06 |
faho (Fabian Homborg) | Oh, that was apparently removed? | 19:45:34 |
15 Apr 2021 |
scorphus (Pablo Aguiar) |
@scorphus fish-shell/fish-shell@ef96a66
Thank you, @faho! Much appreciated! 🙌 | 10:07:29 |
alenpaul2001 | function testing
argparse e/exclude -- $argv;
for x in $_flag_exclude
echo $x;
end
end
| 11:40:39 |
alenpaul2001 | How do we print out values given to exclude? | 11:41:12 |
alenpaul2001 | * function testing
argparse e/exclude -- $argv;
for x in $_flag_exclude
echo $x;
end
end
| 11:41:59 |
faho (Fabian Homborg) | @alenpaul2001:matrix.org You're not giving values to exclude, it's defined as a boolean "there or not" flag. | 13:03:43 |
faho (Fabian Homborg) | To allow it to receive values, like --exclude=foo , define it as e/exclude= . | 13:03:59 |
faho (Fabian Homborg) | The = means it takes values, =+ means it can appear multiple times and all values are stored, and =? means it takes an optional value (which must be directly attached like --exclude=foo and can't be given as --exclude foo - because otherwise how would you not give it a value if you gave positional arguments?) | 13:06:32 |
alenpaul2001 | wokey so -- was the culprit? | 13:48:16 |
faho (Fabian Homborg) | @alenpaul2001:matrix.org No? | 14:28:55 |
faho (Fabian Homborg) | The missing = was. The -- is mandatory! | 14:29:04 |
faho (Fabian Homborg) | Just to be clear, your argparse call should be argparse e/exclude= -- $argv
not argparse e/exclude -- $argv | 14:30:11 |
alenpaul2001 | ok thank you | 18:27:35 |
16 Apr 2021 |
PatrickF1 (Patrick) | Hi fish experts. I want to execute a fish autoloaded function with a timeout. I've already tried SHELL=fish timeout autoloaded_function and timeout SHELL=fish autoloaded_function but to no avail. Timeout can't find the command autoloaded_function. Any ideas, please? | 01:50:54 |
PatrickF1 (Patrick) | * Hi fish experts. I want to execute a fish autoloaded function with a timeout. I've already tried SHELL=fish timeout autoloaded_function and timeout SHELL=fish autoloaded_function but to no avail. Timeout can't find the command autoloaded_function. Any ideas, please? | 01:51:04 |
faho (Fabian Homborg) | @PatrickF1 timeout is an external program and I don't think it uses $SHELL? Try timeout fish -c 'autoloaded_function' | 06:21:13 |
faho (Fabian Homborg) | (also timeout is not a common utility that's available everywhere) | 06:21:31 |
| xiosix joined the room. | 10:01:07 |
faho (Fabian Homborg) | PSA: Please don't make fish your /bin/sh. It's not meant for that. | 14:41:37 |
PatrickF1 (Patrick) | Thank you Fabian. What if my function is not autoloaded but dynamically created? | 16:22:23 |
faho (Fabian Homborg) | @PatrickF1 Well, then you'll have to create it in that shell, just like if $SHELL had worked. timeout is an external command. Anything it does is out-of-process. | 17:34:03 |
PatrickF1 (Patrick) | Gotcha, that makes sense. Thank you. I actually need something in-process. Is there any other way to simulate a timeout within fish? | 18:45:42 |
PatrickF1 (Patrick) | * Gotcha, that makes sense. Thank you. I actually need something in-process. Is there any other way to simulate a timeout within fish? | 18:45:46 |
faho (Fabian Homborg) | Fish currently provides no facilities to do a timeout, no | 18:53:51 |
faho (Fabian Homborg) | #1134 | 19:01:21 |
PatrickF1 (Patrick) | Underandable. Thanks again for all your help, Fabian | 21:30:04 |
17 Apr 2021 |
| highersource joined the room. | 11:27:32 |
| @izen:matrix.org joined the room. | 12:21:54 |
| @izen:matrix.org left the room. | 12:22:27 |