summaryrefslogtreecommitdiffstats
path: root/completion.bash
Commit message (Collapse)AuthorAgeFilesLines
* bash-completion: complete projects with repo forallMike Frysinger2021-07-271-1/+21
| | | | | | | | | | | We need to add a little bit more logic here so we stop completing projects once we see the -c argument. Bug: https://crbug.com/gerrit/14797 Change-Id: Ic2ba4f3dd616ec49d8ad754ff62d0d6e0250dbe6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312905 Reviewed-by: Xin Li <delphij@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* list: add a --relative-to optionMike Frysinger2021-07-271-0/+1
| | | | | | | | | | | | | | | The current list output only shows project paths relative to the root of the repo client checkout. It can be helpful to also get a listing of paths based on other paths (e.g. the current working directory), so add an option to repo list to support that. We'll leverage this in bash completion to support completing projects by their local paths and not just remote names. Bug: https://crbug.com/gerrit/14797 Change-Id: Ia2b35d18c890217768448118b003874a1016efd4 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312904 Reviewed-by: Xin Li <delphij@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* bash-completion: refactor unique subcommand processingMike Frysinger2021-07-271-15/+27
| | | | | | | | | | | | | Let's keep the main processing loop free of subcommand implementations by pulling the existing help & start commands into dedicated functions. Having a single giant function is harder to track as we add more and more logic in. Bug: https://crbug.com/gerrit/14797 Change-Id: I2b62dc430c0e7574f09aa4838f4ef03fbe4bf7fb Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312903 Reviewed-by: Xin Li <delphij@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* bash-completion: fallback to default completionMike Frysinger2021-07-271-1/+3
| | | | | | | | | | | | | If we can't provide any completions, then fallback to the standard bash & readline ones. This allows completion based on the user's settings (e.g. local paths) to kick in. Bug: https://crbug.com/gerrit/14797 Test: `repo rebase ./src/<tab>` works in a CrOS checkout Change-Id: Iced343c4fc6fd3a932aab99875c1346687d187b6 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/312902 Reviewed-by: Xin Li <delphij@google.com> Tested-by: Mike Frysinger <vapier@google.com>
* bash-completion: initial import based on CrOS versionMike Frysinger2021-03-151-0/+121
We've had a limited version of this in CrOS for a long time. There's nothing CrOS specific about it, so lets move it to the repo project so everyone can utilize it. Change-Id: I04cd94610c1100f3afcd2baf8c8e7ab13e589490 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/299202 Reviewed-by: Michael Mortensen <mmortensen@google.com> Tested-by: Mike Frysinger <vapier@google.com>