mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-01-24 13:09:31 -06:00
33 lines
742 B
Go
33 lines
742 B
Go
package trash
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
func SetupCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
GroupID: "app",
|
|
Use: "trash",
|
|
Short: "Trash",
|
|
}
|
|
flags := cmd.PersistentFlags()
|
|
flags.Bool("auto-migrate", true, "Automatically migrate database schema")
|
|
viper.BindPFlag("auto_migrate", flags.Lookup("auto-migrate"))
|
|
|
|
flags.StringP("default-storage-dir", "S", "storage/default", "Default Storage Directory")
|
|
viper.BindPFlag("default_storage_dir", flags.Lookup("default-storage-dir"))
|
|
|
|
flags.StringP("user", "u", "phylum", "User")
|
|
|
|
cmd.AddCommand(
|
|
setupDeleteCommand(),
|
|
setupEmptyCommand(),
|
|
setupListCommand(),
|
|
setupRestoreCommand(),
|
|
setupSummaryCommand(),
|
|
)
|
|
|
|
return cmd
|
|
}
|