diff --git a/cmd/root.go b/cmd/root.go index fd0d4ce..4a77fbf 100644 --- a/cmd/root.go +++ b/cmd/root.go @@ -8,7 +8,7 @@ import ( ) var rootCmd = &cobra.Command{ - Use: "drogobox", + Use: "drogobox", Short: "DroGoBox is just a dumb project", Long: `DroGoBox is just a dumb project an alternative to Nextcloud written with Go @@ -19,6 +19,18 @@ var rootCmd = &cobra.Command{ }, } +var listCmd = &cobra.Command{ + Use: "list [directory]", + Short: "List the contents of a directory", + Args: cobra.MaximumNArgs(1), + RunE: func(cmd *cobra.Command, args []string) error { + name := "world" + + fmt.Printf("Hello, %s!\n", name) + return nil + }, +} + func Execute() { if err := rootCmd.Execute(); err != nil { fmt.Fprintln(os.Stderr, err) @@ -27,5 +39,5 @@ func Execute() { } func init() { - // + rootCmd.AddCommand(listCmd) }