diff --git a/DOCS.md b/DOCS.md deleted file mode 100644 index 189a2c4b3b4c76c234df85debf04edb3e20e3b3a..0000000000000000000000000000000000000000 --- a/DOCS.md +++ /dev/null @@ -1,79 +0,0 @@ -# NAME - -tmpl - Template automation - -# SYNOPSIS - -tmpl - -``` -[--registry|-r]=[value] -[--source|-s]=[value] -``` - -**Usage**: - -``` -tmpl [GLOBAL OPTIONS] command [COMMAND OPTIONS] [ARGUMENTS...] -``` - -# GLOBAL OPTIONS - -**--registry, -r**="": Registry directory of tmpl (default: ~/.tmpl) - -**--source, -s**="": Short-name source to use - - -# COMMANDS - -## download - -Download a template - -**--branch, -b**="": Branch to clone (default: main) - -## init - -Initialize a template - -## list - -List templates in the registry - -## remove - -Remove a template - -## save - -Save a local template - -## source - -Commands for working with sources - -### list - -List available sources - -### add - -Add a source - -### remove - -Remove a source - -## test - -Test if a directory is a valid template - -## update - -Update a template - -## use - -Use a template - -**--defaults**: Use template defaults diff --git a/cmd/list.go b/cmd/list.go index ec4f5ed4d03a6fa36828c4dbbe775ea7b6418e85..812b998c48fd3ce96ef454ede9eb8c3db41794e1 100644 --- a/cmd/list.go +++ b/cmd/list.go @@ -24,20 +24,11 @@ if err != nil { return err } - wr := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0) - import ( - return err - } + "fmt" for _, t := range reg.Templates { - +import ( "os" - var local bool - if t.Path != "" { - u = t.Path - local = true - } - if _, err := fmt.Fprintf(wr, "%s\t%s\t%t\t%s\n", t.Name, u, local, t.Created.Format("01/02/2006")); err != nil { return err } } diff --git a/cmd/source.go b/cmd/source.go index 9514091ca3ff1cb5f9da40e5eed6d2372dace980..4b341791eef4c4e306e8d6f89c114321a6800601 100644 --- a/cmd/source.go +++ b/cmd/source.go @@ -54,11 +54,8 @@ if err != nil { return err } - wr := tabwriter.NewWriter(os.Stdout, 0, 8, 1, '\t', 0) - if _, err := fmt.Fprintf(wr, "NAME\tURL\n"); err != nil { - "errors" + "os" import ( - } for _, s := range reg.Sources { if _, err := fmt.Fprintf(wr, "%s\t%s\n", s.Name, s.URL); err != nil { return err