Skip to content

gh gist create only shows privacy status when filename is provided #7644

@seanbright

Description

@seanbright

Describe the bug

When creating a gist with gh gist create, if you do not specify a filename the output of the command does not indicate if it is a public or secret gist.

$ gh --version
gh version 2.31.0 (2023-06-20)
https://github.com/cli/cli/releases/tag/v2.31.0
$ echo foo | gh gist create
- Creating gist...
✓ Created gist
https://gist.github.com/seanbright/...
$ echo foo | gh gist create --public
- Creating gist...
✓ Created gist
https://gist.github.com/seanbright/...
$ echo foo | gh gist create --filename foo.txt
- Creating gist foo.txt
✓ Created secret gist foo.txt
https://gist.github.com/seanbright/...
$ echo foo | gh gist create --filename foo.txt --public
- Creating gist foo.txt
✓ Created public gist foo.txt
https://gist.github.com/seanbright/...

Note that only the last 2 where --filename was provided are showing secret and public in the output.

Steps to reproduce the behavior

  1. Type $ echo foo | gh gist create --public and note that the output does not show public
  2. Type $ echo foo | gh gist create --public --filename foo.txt and note that the output does show public

Expected vs actual behavior

I expect the privacy status to appear in the output unconditionally.

Logs

See above.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIhelp wantedContributions welcome

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions