diff --git a/cmd/update.go b/cmd/update.go index 9d47bbb..d43f434 100644 --- a/cmd/update.go +++ b/cmd/update.go @@ -32,7 +32,7 @@ var ( skipConfirmation, _ := cmd.Flags().GetBool("yes") // Check if --url flag is used - if url != "" { + if cmd.Flags().Changed("url") { if len(args) != 1 { cError.Println("Update only accepts one index while using --url flag") return @@ -45,6 +45,11 @@ var ( } } + // Check if --excerpt flag is used + if !cmd.Flags().Changed("excerpt") { + excerpt = "|-|-|" + } + // If no arguments, confirm to user if len(args) == 0 && !skipConfirmation { confirmUpdate := "" @@ -153,7 +158,7 @@ func updateBookmarks(indices []string, url, title, excerpt string, tags []string bookmarks[i].Title = title } - if excerpt != "" { + if excerpt != "|-|-|" { bookmarks[i].Excerpt = excerpt }