Skip to content

gh gist edit: use prefix matching for gist id #7000

@tuananhlai

Description

@tuananhlai

Describe the feature or problem you’d like to solve

Currently, gh gist edit command requires the user to put in the full Gist ID. I'd like to put in only the first few characters from the gist ID.

Proposed solution

  • Select the gist with the longest-matching prefix. If no gist matched, display gist not found as usual.
  • If there are 2 or more gists with the same prefix, display a selector.
vscode ➜ /workspaces/cli (trunk) $ gh gist edit 0c909
Editing gist 0c9097af4101ce6d43615d01e66dbbfa
? Edit which file?  [Use arrows to move, type to filter]
> Makefile
  README.md
  btree.go
  btree_test.go
vscode ➜ /workspaces/cli (trunk) $ gh gist edit 0c909
There are multiple gist matching '0c909'. Which one do you want to edit?
> 0c9097af4101ce6d43615d01e66dbbfa
  0c9098122c98006d2fd5b9f9eb5c5ac3

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementa request to improve CLIgh-gistrelating to the gh gist commandneeds-designAn engineering task needs design to proceed

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions