Skip to content

Commit f1a2335

Browse files
authored
Merge pull request #451 from carlosms/parse-drivers-cmd
Rename 'parse drivers list' sub command to 'parse drivers'
2 parents 308b175 + 7c3163e commit f1a2335

File tree

6 files changed

+8
-19
lines changed

6 files changed

+8
-19
lines changed

CHANGELOG.md

+1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
- `srcd` commands do not have a `-v/--verbose` flag anymore, it has been replaced with the `--log-level=debug` option ([#410](https://github.com/src-d/engine/issues/410)).
1818
- The `srcd/cli-daemon` docker image executable now requires to use the `serve` sub command. This does not affect end users ([#410](https://github.com/src-d/engine/issues/410)).
19+
- Command `srcd parse drivers list` has been renamed to `srcd parse drivers` ([#320](https://github.com/src-d/engine/issues/320)).
1920

2021
### New Features
2122

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -255,7 +255,7 @@ srcd parse uast --lang=LANGUAGE /path/to/file
255255
To see the installed language drivers:
256256

257257
```bash
258-
srcd parse drivers list
258+
srcd parse drivers
259259
```
260260

261261
### 5. Start Executing Queries

cmd/srcd/cmd/drivers.go

+4-4
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ import (
99
"github.com/src-d/engine/cmd/srcd/daemon"
1010
)
1111

12-
// parseDriversListCmd represents the parse drivers list command
13-
type parseDriversListCmd struct {
14-
Command `name:"list" short-description:"List installed language drivers" long-description:"List installed language drivers"`
12+
// parseDriverCmd represents the parse drivers command
13+
type parseDriverCmd struct {
14+
Command `name:"drivers" short-description:"List installed language drivers" long-description:"List installed language drivers"`
1515
}
1616

17-
func (cmd *parseDriversListCmd) Execute(args []string) error {
17+
func (cmd *parseDriverCmd) Execute(args []string) error {
1818
c, err := daemon.Client()
1919
if err != nil {
2020
return humanizef(err, "could not get daemon client")

cmd/srcd/cmd/parse.go

+1-8
Original file line numberDiff line numberDiff line change
@@ -173,18 +173,11 @@ func (cmd *parseLangCmd) Execute(args []string) error {
173173
return nil
174174
}
175175

176-
// parseDriversCmd represents the parse drivers command
177-
type parseDriversCmd struct {
178-
cli.PlainCommand `name:"drivers" short-description:"Manage language drivers" long-description:"Manage language drivers"`
179-
}
180-
181176
func init() {
182177
c := rootCmd.AddCommand(&parseCmd{})
183178
c.AddCommand(&parseUASTCmd{})
184179
c.AddCommand(&parseLangCmd{})
185-
186-
driversCmd := c.AddCommand(&parseDriversCmd{})
187-
driversCmd.AddCommand(&parseDriversListCmd{})
180+
c.AddCommand(&parseDriverCmd{})
188181
}
189182

190183
func parseModeArg(mode string) (api.ParseRequest_UastMode, error) {

cmdtests/parse_test.go

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ var testCases = []testCase{
8787
func (s *ParseTestSuite) TestDriversList() {
8888
require := s.Require()
8989

90-
r := s.RunCommand("parse", "drivers", "list")
90+
r := s.RunCommand("parse", "drivers")
9191
require.NoError(r.Error, r.Combined())
9292

9393
/* Example output:

docs/commands.md

-5
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ they've been implemented.
1111
- [srcd parse uast](#srcd-parse-uast)
1212
- [srcd parse lang](#srcd-parse-lang)
1313
- [srcd parse drivers](#srcd-parse-drivers)
14-
- [srcd parse drivers list](#srcd-parse-drivers-list)
1514
- [srcd sql](#srcd-sql)
1615
- [srcd web](#srcd-web)
1716
- [srcd web parse](#srcd-web-parse)
@@ -111,10 +110,6 @@ Identifies the language of the given file.
111110
*flags*:
112111

113112
### srcd parse drivers
114-
All of the subcomands of `srcd parse drivers` provide management for
115-
the language drivers installed on `bblfsh`.
116-
117-
#### srcd parse drivers list
118113
Lists all of the drivers already installed on `bblfsh` together with the
119114
version installed.
120115

0 commit comments

Comments
 (0)