diff --git a/cmd/oo/projects_files.go b/cmd/oo/projects_files.go index fb41f57..fe18d6c 100644 --- a/cmd/oo/projects_files.go +++ b/cmd/oo/projects_files.go @@ -22,6 +22,7 @@ func projectFilesCmd() *cobra.Command { } cmd.AddCommand(prjFilesListCmd()) cmd.AddCommand(prjFilesUploadCmd()) + cmd.AddCommand(prjFilesUpdateCmd()) cmd.AddCommand(prjFilesDownloadCmd()) cmd.AddCommand(prjFilesRenameCmd()) cmd.AddCommand(prjFilesDeleteCmd()) @@ -149,6 +150,26 @@ Pass --no-replace to fail when the name is taken; --allow-duplicate to always cr return cmd } +func prjFilesUpdateCmd() *cobra.Command { + return &cobra.Command{ + Use: "update FILE_ID LOCAL_PATH", + Short: "Overwrite an existing Documents file with new content (new version)", + Args: cobra.ExactArgs(2), + RunE: func(cmd *cobra.Command, args []string) error { + c, err := newOO(cmd) + if err != nil { + return err + } + entry, err := c.UpdateFile(cmd.Context(), args[0], args[1]) + if err != nil { + return err + } + printObject(fileEntryToMap(entry)) + return nil + }, + } +} + func prjFilesDownloadCmd() *cobra.Command { var to string cmd := &cobra.Command{