mirror of
https://codeberg.org/shroff/phylum.git
synced 2026-01-07 12:10:26 -06:00
35 lines
811 B
Go
35 lines
811 B
Go
package fs
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"github.com/spf13/viper"
|
|
)
|
|
|
|
func SetupCommand() *cobra.Command {
|
|
cmd := &cobra.Command{
|
|
Use: "fs",
|
|
Short: "Filesystem Access",
|
|
}
|
|
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", "Specify user for resource operations")
|
|
|
|
cmd.AddCommand(
|
|
setupCatCommand(),
|
|
setupChpermCommand(),
|
|
setupCpCommand(),
|
|
setupImportCommand(),
|
|
setupLsCommand(),
|
|
setupMkdirCommand(),
|
|
setupMvCommand(),
|
|
setupRmCommand(),
|
|
)
|
|
|
|
return cmd
|
|
}
|