Added documentation on glide tree and glide list.
Also removed the requirement for a glide.yaml file for these two
to function.
diff --git a/README.md b/README.md
index fd52b41..59f6697 100644
--- a/README.md
+++ b/README.md
@@ -179,6 +179,49 @@
will create the `.a` files, which can have a positive impact on your
build times.
+### glide tree
+
+Glide includes a few commands that inspect code and give you details
+about what is imported. `glide tree` is one such command. Running it
+gives data like this:
+
+```
+$ glide tree
+github.com/Masterminds/glide
+ github.com/Masterminds/cookoo (/Users/mbutcher/Code/Go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/cookoo)
+ github.com/Masterminds/cookoo/io (/Users/mbutcher/Code/Go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/cookoo/io)
+ github.com/Masterminds/glide/cmd (/Users/mbutcher/Code/Go/src/github.com/Masterminds/glide/cmd)
+ github.com/Masterminds/cookoo (/Users/mbutcher/Code/Go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/cookoo)
+ github.com/Masterminds/cookoo/io (/Users/mbutcher/Code/Go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/cookoo/io)
+ github.com/Masterminds/vcs (/Users/mbutcher/Code/Go/src/github.com/Masterminds/glide/vendor/github.com/Masterminds/vcs)
+ github.com/codegangsta/cli (/Users/mbutcher/Code/Go/src/github.com/Masterminds/glide/vendor/github.com/codegangsta/cli)
+ github.com/kylelemons/go-gypsy/yaml (/Users/mbutcher/Code/Go/src/github.com/Masterminds/glide/vendor/github.com/kylelemons/go-gypsy/yaml)
+ github.com/codegangsta/cli (/Users/mbutcher/Code/Go/src/github.com/Masterminds/glide/vendor/github.com/codegangsta/cli)
+```
+
+This shows a tree of imports, excluding core libraries. Because
+vendoring makes it possible for the same package to live in multiple
+places, `glide tree` also prints the location of the package being
+imported.
+
+### glide list
+
+Glide's `list` command shows an alphabetized list of all the packages
+that a project imports.
+
+```
+$ glide list
+github.com/Masterminds/cookoo (Present: yes)
+github.com/Masterminds/cookoo/io (Present: yes)
+github.com/Masterminds/glide/cmd (Present: yes)
+github.com/Masterminds/vcs (Present: yes)
+github.com/codegangsta/cli (Present: yes)
+github.com/kylelemons/go-gypsy/yaml (Present: yes)
+```
+
+If it finds a reference to a package that has not been installed,
+`Present` is set to `no`.
+
### glide help
Print the glide help.
diff --git a/glide.go b/glide.go
index 47f6424..7d7e3d0 100644
--- a/glide.go
+++ b/glide.go
@@ -323,7 +323,7 @@
Description: `This scans a project's source files and builds a tree
representation of the import graph.
- It ignores testdata/ and directories that begin with _. Packages in
+ It ignores testdata/ and directories that begin with . or _. Packages in
vendor/ are only included if they are referenced by the main project or
one of its dependencies.`,
Action: func(c *cli.Context) {
@@ -333,6 +333,14 @@
{
Name: "list",
Usage: "List prints all dependencies that Glide could discover.",
+ Description: `List scans your code and lists all of the packages that are used.
+
+ It does not use the glide.yaml. Instead, it inspects the code to determine what packages are
+ imported.
+
+ Directories taht begin with . or _ are ignored, as are testdata directories. Packages in
+ vendor are only included if they are used by the project.
+ `,
Action: func(c *cli.Context) {
setupHandler(c, "list", cxt, router)
},
@@ -503,14 +511,10 @@
reg.Route("tree", "Print a dependency graph.").
Includes("@startup").
- Includes("@ready").
- Does(cmd.Tree, "tree").
- Using("conf").From("cxt:cfg")
+ Does(cmd.Tree, "tree")
reg.Route("list", "Print a dependency graph.").
Includes("@startup").
- Includes("@ready").
- Does(cmd.ListDeps, "list").
- Using("conf").From("cxt:cfg")
+ Does(cmd.ListDeps, "list")
reg.Route("nv", "No Vendor").
Includes("@startup").