cmd

package
v0.8.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 9, 2019 License: MIT Imports: 27 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CmdAccount = cli.Command{
		Name:  "account",
		Usage: "Manage account for accessing web interface",
		Subcommands: []cli.Command{
			subcmdAddAccount,
			subcmdPrintAccounts,
			subcmdDeleteAccounts,
		},
	}
)
View Source
var (
	CmdAdd = cli.Command{
		Name:  "add",
		Usage: "Bookmark the specified URL",
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "title, i",
				Usage: "Custom title for this bookmark",
			},
			cli.StringFlag{
				Name:  "excerpt, e",
				Usage: "Custom excerpt for this bookmark",
			},
			cli.StringSliceFlag{
				Name:  "tags, t",
				Usage: "Comma-separated tags for this bookmark",
			},
			cli.BoolFlag{
				Name:  "offline, o",
				Usage: "Save bookmark without fetching data from internet",
			},
		},
		Action: runAddBookmark,
	}
)
View Source
var (
	CmdDelete = cli.Command{
		Name:  "delete",
		Usage: "Delete the saved bookmarks",
		Description: "Delete bookmarks. " +
			"When a record is deleted, the last record is moved to the removed index. " +
			"Accepts space-separated list of indices (e.g. 5 6 23 4 110 45), hyphenated range (e.g. 100-200) or both (e.g. 1-3 7 9). " +
			"If no arguments, all records will be deleted.",
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "yes, y",
				Usage: "Skip confirmation prompt and delete ALL bookmarks",
			},
		},
		Action: runDeleteBookmark,
	}
)
View Source
var (
	CmdExport = cli.Command{
		Name:   "export",
		Usage:  "Export bookmarks into HTML file in Netscape Bookmark format",
		Action: runExportBookmarks,
	}
)
View Source
var (
	CmdImport = cli.Command{
		Name:  "import",
		Usage: "Import bookmarks from HTML file in Netscape Bookmark format",
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "generate-tag, t",
				Usage: "Auto generate tag from bookmark's category",
			},
		},
		Action: runImportBookmarks,
	}
)
View Source
var (
	CmdOpen = cli.Command{
		Name:  "open",
		Usage: "Open the saved bookmarks",
		Description: "Open bookmarks in browser. " +
			"Accepts space-separated list of indices (e.g. 5 6 23 4 110 45), hyphenated range (e.g. 100-200) or both (e.g. 1-3 7 9). " +
			"If no arguments, ALL bookmarks will be opened.",
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "yes, y",
				Usage: "Skip confirmation prompt and open ALL bookmarks",
			},
			cli.BoolFlag{
				Name:  "cache, c",
				Usage: "Open the bookmark's cache in text-only mode",
			},
			cli.BoolFlag{
				Name:  "trim-space",
				Usage: "Trim all spaces and newlines from the bookmark's cache",
			},
		},
		Action: runOpenBookmark,
	}
)
View Source
var (
	CmdPocket = cli.Command{
		Name:   "pocket",
		Usage:  "Import bookmarks from Pocket's exported HTML file",
		Action: runImportPocket,
	}
)
View Source
var (
	CmdPrint = cli.Command{
		Name:    "print",
		Usage:   "Print the saved bookmarks to command line",
		Aliases: []string{"list", "ls"},
		Description: "Show the saved bookmarks by its DB index. " +
			"Accepts space-separated list of indices (e.g. 5 6 23 4 110 45), hyphenated range (e.g. 100-200) or both (e.g. 1-3 7 9). " +
			"If no arguments, all records with actual index from DB are shown.",

		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "index-only, i",
				Usage: "Only print the index of bookmarks",
			},
			cli.BoolFlag{
				Name:  "json, j",
				Usage: "Output data in JSON format",
			},
		},
		Action: runPrintBookmarks,
	}
)
View Source
var (
	CmdSearch = cli.Command{
		Name:  "search",
		Usage: "Search bookmarks by submitted keyword",
		Description: "Search bookmarks by looking for matching keyword in bookmark's title and content. " +
			"If no keyword submitted, print all saved bookmarks. ",
		Flags: []cli.Flag{
			cli.BoolFlag{
				Name:  "index-only, i",
				Usage: "Only print the index of bookmarks",
			},
			cli.BoolFlag{
				Name:  "json, j",
				Usage: "Output data in JSON format",
			},
			cli.StringSliceFlag{
				Name:  "tags, t",
				Usage: "Search bookmarks with specified tag(s)",
			},
		},
		Action: runSearchBookmarks,
	}
)
View Source
var (
	CmdUpdate = cli.Command{
		Name:  "update",
		Usage: "Update the saved bookmarks",
		Description: "Update fields of an existing bookmark. " +
			"Accepts space-separated list of indices (e.g. 5 6 23 4 110 45), hyphenated range (e.g. 100-200) or both (e.g. 1-3 7 9). " +
			"If no arguments, ALL bookmarks will be updated. Update works differently depending on the flags:\n" +
			"- If indices are passed without any flags (--url, --title, --tag and --excerpt), read the URLs from DB and update titles from web.\n" +
			"- If --url is passed (and --title is omitted), update the title from web using the URL. While using this flag, update only accept EXACTLY one index.\n" +
			"While updating bookmark's tags, you can use - to remove tag (e.g. -nature to remove nature tag from this bookmark).",
		Flags: []cli.Flag{
			cli.StringFlag{
				Name:  "url, u",
				Usage: "New URL for this bookmark",
			},
			cli.StringFlag{
				Name:  "title, i",
				Usage: "New title for this bookmark",
			},
			cli.StringFlag{
				Name:  "excerpt, e",
				Usage: "New excerpt for this bookmark",
			},
			cli.StringSliceFlag{
				Name:  "tags, t",
				Usage: "Comma-separated tags for this bookmark",
			},
			cli.BoolFlag{
				Name:  "offline, o",
				Usage: "Update bookmark without fetching data from internet",
			},
			cli.BoolFlag{
				Name:  "yes, y",
				Usage: "Skip confirmation prompt and update ALL bookmarks",
			},
			cli.BoolFlag{
				Name:  "dont-overwrite",
				Usage: "Don't overwrite existing metadata. Useful when only want to update bookmark's content",
			},
		},
		Action: runUpdateBookmarks,
	}
)

Functions

This section is empty.

Types

This section is empty.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL