!YLTeaulxSDauOOxBoR:matrix.org

#fish-shell

432 Members
fish is a smart and user-friendly command line shell for Linux, macOS, and the rest of the family https://fishshell.com/34 Servers

Load older messages


SenderMessageTime
14 Apr 2021
@faho-55c2568b0fc9f982beac5856:gitter.imfaho (Fabian Homborg) Oh, and function explains that it's --current-function. 19:44:06
@faho-55c2568b0fc9f982beac5856:gitter.imfaho (Fabian Homborg) Oh, that was apparently removed? 19:45:34
15 Apr 2021
@scorphus-554ee78b15522ed4b3e02bea:gitter.imscorphus (Pablo Aguiar)

@scorphus fish-shell/fish-shell@ef96a66

Thank you, @faho! Much appreciated! 🙌

10:07:29
@alenpaul2001:matrix.orgalenpaul2001
function testing
        argparse e/exclude -- $argv;
        for x in $_flag_exclude
                echo $x;
        end
end
11:40:39
@alenpaul2001:matrix.orgalenpaul2001How do we print out values given to exclude?11:41:12
@alenpaul2001:matrix.orgalenpaul2001 *
function testing
        argparse e/exclude -- $argv;
        for x in $_flag_exclude
                echo $x;
        end
end
11:41:59
@faho-55c2568b0fc9f982beac5856:gitter.imfaho (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-55c2568b0fc9f982beac5856:gitter.imfaho (Fabian Homborg) To allow it to receive values, like --exclude=foo, define it as e/exclude=. 13:03:59
@faho-55c2568b0fc9f982beac5856:gitter.imfaho (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:matrix.orgalenpaul2001wokey so -- was the culprit?13:48:16
@faho-55c2568b0fc9f982beac5856:gitter.imfaho (Fabian Homborg) @alenpaul2001:matrix.org No? 14:28:55
@faho-55c2568b0fc9f982beac5856:gitter.imfaho (Fabian Homborg) The missing = was. The -- is mandatory! 14:29:04
@faho-55c2568b0fc9f982beac5856:gitter.imfaho (Fabian Homborg)

Just to be clear, your argparse call should be

argparse e/exclude= -- $argv

not

argparse e/exclude -- $argv
14:30:11
@alenpaul2001:matrix.orgalenpaul2001ok thank you18:27:35
16 Apr 2021
@patrickf1-5f35c70cd73408ce4fec2e53:gitter.imPatrickF1 (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-5f35c70cd73408ce4fec2e53:gitter.imPatrickF1 (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-55c2568b0fc9f982beac5856:gitter.imfaho (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-55c2568b0fc9f982beac5856:gitter.imfaho (Fabian Homborg) (also timeout is not a common utility that's available everywhere) 06:21:31
@xiosix:matrix.orgxiosix joined the room.10:01:07
@faho-55c2568b0fc9f982beac5856:gitter.imfaho (Fabian Homborg) PSA: Please don't make fish your /bin/sh. It's not meant for that. 14:41:37
@patrickf1-5f35c70cd73408ce4fec2e53:gitter.imPatrickF1 (Patrick) Thank you Fabian. What if my function is not autoloaded but dynamically created? 16:22:23
@faho-55c2568b0fc9f982beac5856:gitter.imfaho (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-5f35c70cd73408ce4fec2e53:gitter.imPatrickF1 (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-5f35c70cd73408ce4fec2e53:gitter.imPatrickF1 (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-55c2568b0fc9f982beac5856:gitter.imfaho (Fabian Homborg) Fish currently provides no facilities to do a timeout, no 18:53:51
@faho-55c2568b0fc9f982beac5856:gitter.imfaho (Fabian Homborg) #1134 19:01:21
@patrickf1-5f35c70cd73408ce4fec2e53:gitter.imPatrickF1 (Patrick) Underandable. Thanks again for all your help, Fabian 21:30:04
17 Apr 2021
@highersource:matrix.orghighersource joined the room.11:27:32
@izen:matrix.org@izen:matrix.org joined the room.12:21:54
@izen:matrix.org@izen:matrix.org left the room.12:22:27

There are no newer messages yet.


Back to Room List