~emersion/hut

bc07a846c58c45f042035935c767a2f4c4ad0872 — Thorben Günther 2 months ago 3c1f0b0
paste delete: Accept URLs

References: https://todo.sr.ht/~emersion/hut/12
1 files changed, 4 insertions(+), 2 deletions(-)

M paste.go
M paste.go => paste.go +4 -2
@@ 97,9 97,11 @@ func newPasteCreateCommand() *cobra.Command {
func newPasteDeleteCommand() *cobra.Command {
	run := func(cmd *cobra.Command, args []string) {
		ctx := cmd.Context()
		c := createClient("paste", cmd)

		for _, id := range args {
		for _, arg := range args {
			id, _, instance := parseResourceName(arg)
			c := createClientWithInstance("paste", cmd, instance)

			paste, err := pastesrht.Delete(c.Client, ctx, id)
			if err != nil {
				log.Fatalf("failed to delete paste %s: %v", id, err)