()
| 11 | } |
| 12 | |
| 13 | func newPathsCmd() *pathsCmd { |
| 14 | cmd := &cobra.Command{ |
| 15 | Use: "paths", |
| 16 | Short: "Print the paths being used for logs, data et al", |
| 17 | Args: cobra.NoArgs, |
| 18 | RunE: func(cmd *cobra.Command, args []string) error { |
| 19 | project := cmd.Parent().Flag("project").Value.String() |
| 20 | logfile, dbfile, err := paths(project) |
| 21 | if err != nil { |
| 22 | return err |
| 23 | } |
| 24 | fmt.Println("Database path:", dbfile) |
| 25 | fmt.Println("Log path: ", logfile) |
| 26 | return nil |
| 27 | }, |
| 28 | } |
| 29 | return &pathsCmd{cmd: cmd} |
| 30 | } |