Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add more matchers to the tab completion DSL #314

Open
2 of 9 tasks
georgebrock opened this issue Aug 11, 2017 · 3 comments
Open
2 of 9 tasks

Add more matchers to the tab completion DSL #314

georgebrock opened this issue Aug 11, 2017 · 3 comments

Comments

@georgebrock
Copy link
Collaborator

georgebrock commented Aug 11, 2017

Various rules in the completions file use the a less specific matcher to represent a specific value. In many cases we use the $anything matcher, e.g.

log $opt*
  --tags $anything?

These could be replaced with more specific matchers, e.g.

log $opt*
  --tags $tag?

The following things could be useful:

  • $stash for the names of Git stashes, e.g. stash show $stash
  • $tag for the names of Git tags, e.g. log --tags $tag
  • $dir_path for paths that should always be a directory not a file, e.g. :cd $dir_path
  • $branch for revisions that should always be a branch name, e.g. branch --delete $branch
  • $var_name for the names of gitsh variables, e.g. :set $var_name $anything
  • $config_var_name for the names of Git config variables, e.g. config $config_var_name
  • $author for names or emails of contributors to the repo, e.g. log --author $author
  • $modified_path for paths that have uncommitted changes, e.g. add $modified_path
  • $ctag for program symbols defined in a ctags(1) file, e.g. log -S $ctag
@benknoble
Copy link
Contributor

Not sure if this is the right place to ask, but could gitsh also support completing the single- and double-dash option names? I get this in bash (can't seem to pin down from where though--could be the git completion that ships with homebrew git, or from homebrew bash-complete).

@georgebrock
Copy link
Collaborator Author

@benknoble The currently released version doesn't, but the master branch does. It will be included in the next release.

@georgebrock
Copy link
Collaborator Author

I think $branch and $tag were the most important items on this list. Now they're done, I'm going to move this issue from v0.14 to v1.0.

@georgebrock georgebrock modified the milestones: v0.14, v1.0 Mar 2, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants