mirror of
https://github.com/bootandy/dust.git
synced 2026-06-08 11:29:05 +03:00
[GH-ISSUE #199] dust -h panics when stdout is closed
#90
Reference in New Issue
Block a user
Delete Branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @lopopolo on GitHub (Nov 29, 2021).
Original GitHub issue: https://github.com/bootandy/dust/issues/199
Clap provides a
get_matches_from_safeAPI that returns aResultrather than panicking when failing to write to stdout.Here's some MIT-licensed code I use in one of my projects that does this dance in a panic-free way:
https://github.com/artichoke/artichoke/blob/d527412f9438aeba4cadb1f4303237f6f9e0cd4d/src/bin/artichoke.rs#L138-L173
@lopopolo commented on GitHub (Nov 29, 2021):
I've opened up this ticket with upstream clap to see if the maintainers are open to fixing this panic on the v2 branch:
@bootandy commented on GitHub (Dec 3, 2021):
From that thread:
v2.33.4 has been released that fixes this panic
@bootandy commented on GitHub (Feb 26, 2022):
I have moved to Clap 3, this should solve this.