Skip to content

Commit

Permalink
feat: info cmd (#29)
Browse files Browse the repository at this point in the history
  • Loading branch information
notnmeyer authored Jan 21, 2024
1 parent 530d32d commit 2dcab4e
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,5 @@ go.work

# Build directory
dist/

.env
27 changes: 27 additions & 0 deletions cmd/info.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package cmd

import (
"fmt"
"log"

"github.com/notnmeyer/daylog-cli/internal/daylog"
"github.com/spf13/cobra"
)

var infoCmd = &cobra.Command{
Use: "info",
Short: "Display the full path to the logs directory.",
Long: "Display the full path to the logs directory.",
Run: func(cmd *cobra.Command, args []string) {
dl, err := daylog.New(args, config.Project)
if err != nil {
log.Fatal(err)
}

fmt.Printf("Log location: %s\n", dl.ProjectPath)
},
}

func init() {
rootCmd.AddCommand(infoCmd)
}

0 comments on commit 2dcab4e

Please sign in to comment.