dev/sg: command, flag, and argument autocompletions
Created by: bobheadxi
Adds a new dependency in sg setup
that writes the appropriate completion script for your shell into ~/.sourcegraph
and adds a line to your shell config to use the completion script. Completions are generated by sg
itself, so there is no need to be able to update this script (and if we do need to update it, we can consider a migration path then)
urfave/cli
completions work by providing command suggestions by default, and if you use -
TabTab you can get flag completions as well.
Also adds:
- Custom completions based on config for
sg start
,sg run
,sg test
- Custom completions based on valid values for
sg live
,sg ci build
-
=> https://github.com/sourcegraph/sourcegraph/pull/33822sg install --force
(i.e../sg install --force
, now that we can'tsg update -local
anymore😢 ) Also addssg install --profile=false
for convenience
Stacked on https://github.com/sourcegraph/sourcegraph/pull/33758
Test plan
sg autocompletions