24 lines
531 B
Go
24 lines
531 B
Go
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var listCmd = &cobra.Command{
|
|
Use: "list [directory]",
|
|
Short: "List the contents of a directory",
|
|
Long: "List the contents of a directory. Only shows one level deep.",
|
|
Args: cobra.MaximumNArgs(1),
|
|
RunE: func(cmd *cobra.Command, args []string) error {
|
|
|
|
fileStorePath := os.Getenv("STORAGE_PATH")
|
|
resolveFileStorePath(fileStorePath)
|
|
readFilesFromFileStorePath(fileStorePath)
|
|
|
|
return nil
|
|
},
|
|
}
|