Improve command package comments (#251)

This commit is contained in:
François d'Yvoire
2020-02-18 22:42:51 +00:00
committed by GitHub
parent 89e44def83
commit 4fe5aaaccd
11 changed files with 31 additions and 12 deletions

View File

@@ -14,6 +14,7 @@ import (
"github.com/urfave/cli"
)
// CopyCommand is used to register the copy cli command
var CopyCommand = cli.Command{
Name: "copy",
Aliases: []string{"cp"},
@@ -21,12 +22,13 @@ var CopyCommand = cli.Command{
Action: copyAction,
}
// Copies photos to originals path.
// copyAction copies photos to originals path. Default import path is used if no path argument provided
func copyAction(ctx *cli.Context) error {
start := time.Now()
conf := config.NewConfig(ctx)
// very if copy directory exist and is writable
if conf.ReadOnly() {
return config.ErrReadOnly
}
@@ -43,6 +45,7 @@ func copyAction(ctx *cli.Context) error {
conf.MigrateDb()
// get cli first argument
sourcePath := strings.TrimSpace(ctx.Args().First())
if sourcePath == "" {