Skip to content

fix: SuccessResult ignores -I, so ssky delete -I prints prose instead of the URI #95

Description

@mkyutani

Part of #72. Found while writing docs/OUTPUT_FORMATS.md (#76).

Problem

SuccessResult.print() only branches on JSON vs non-JSON:

if format in ('json', 'simple_json'):
    content = self.to_json()
else:
    content = str(self)

So id, text, and long all collapse to the human message. delete is the only
command returning this type, which means:

$ ssky delete at://…/app.bsky.feed.post/abc -I
Post deleted successfully

-I is the format whose contract is "identifier only" — it is what pipelines read. Every
other result type honours it. Getting prose here breaks the composition this project is
built around:

ssky search old-stuff -I | xargs -n1 ssky delete -I   # emits prose, not URIs

Work

  • -I should emit the affected identifier (the deleted post's at://… URI, which
    SuccessResult already carries in data["deleted"])
  • Decide -T and -L: -T as the message is defensible; -L should probably show the
    operation and its target
  • Consider whether SuccessResult should carry a declared identifier field rather than
    each command inventing a data key, since more mutating commands are coming (feat: Add like / unlike commands #87)

Acceptance criteria

  • ssky delete <uri> -I prints the URI and nothing else
  • Behavior specified in docs/OUTPUT_FORMATS.md and the divergence row removed
  • Test covering -I on a mutating command

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingoutputOutput formats and pipe behavior

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions