(cmd *cobra.Command, args []string)
| 379 | } |
| 380 | |
| 381 | func fileMvRun(cmd *cobra.Command, args []string) error { |
| 382 | src, dst := args[0], args[1] |
| 383 | force, err := cmd.Flags().GetBool("force") |
| 384 | if err != nil { |
| 385 | return err |
| 386 | } |
| 387 | |
| 388 | srcPath, err := fixRelativePaths(src) |
| 389 | if err != nil { |
| 390 | return fmt.Errorf("unable to parse src path: %w", err) |
| 391 | } |
| 392 | |
| 393 | _, err = checkFileSize(srcPath, MaxFileSize) |
| 394 | if err != nil { |
| 395 | return err |
| 396 | } |
| 397 | |
| 398 | destPath, err := fixRelativePaths(dst) |
| 399 | if err != nil { |
| 400 | return fmt.Errorf("unable to parse dest path: %w", err) |
| 401 | } |
| 402 | log.Printf("Moving %s to %s; force: %v", srcPath, destPath, force) |
| 403 | rpcOpts := &wshrpc.RpcOpts{Timeout: TimeoutYear} |
| 404 | err = wshclient.FileMoveCommand(RpcClient, wshrpc.CommandFileCopyData{SrcUri: srcPath, DestUri: destPath, Opts: &wshrpc.FileCopyOpts{Overwrite: force, Timeout: TimeoutYear}}, rpcOpts) |
| 405 | if err != nil { |
| 406 | return fmt.Errorf("moving file: %w", err) |
| 407 | } |
| 408 | return nil |
| 409 | } |
| 410 | |
| 411 | func filePrintColumns(filesChan <-chan wshrpc.RespOrErrorUnion[wshrpc.CommandRemoteListEntriesRtnData]) error { |
| 412 | width := 80 |
nothing calls this directly
no test coverage detected