shiori/internal/cmd/add.go

21 lines
555 B
Go
Raw Normal View History

2019-05-21 11:31:40 +08:00
package cmd
import (
"github.com/spf13/cobra"
)
func addCmd() *cobra.Command {
cmd := &cobra.Command{
Use: "add url",
Short: "Bookmark the specified URL",
Args: cobra.ExactArgs(1),
}
cmd.Flags().StringP("title", "i", "", "Custom title for this bookmark.")
cmd.Flags().StringP("excerpt", "e", "", "Custom excerpt for this bookmark.")
cmd.Flags().StringSliceP("tags", "t", []string{}, "Comma-separated tags for this bookmark.")
cmd.Flags().BoolP("offline", "o", false, "Save bookmark without fetching data from internet.")
return cmd
}