cmd

package
v0.0.0-...-2a18eb7 Latest Latest
Warning

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

Go to latest
Published: Jul 31, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RootCmd = &cobra.Command{
	Use:   "mqr",
	Short: "Medium Quick Reader",
	Long:  `mqr makes reading medium in your terminal easy and friendly`,
	Run: func(cmd *cobra.Command, args []string) {
		article, err := medium.GetMostPopularPosts()
		if err != nil {
			fmt.Print(err)
		} else {
			fmt.Print(formatter.FormatArticle(article, &formatter.FormatOptions{
				FormatReference:        true,
				FormatReferenceContent: false,
				FormatReferenceTitle:   true,
				FormatReferenceUID:     true,
				FormatValue:            true,
				FormatValueURL:         true,
			}))
		}
	},
}

RootCmd represents the base command when called without any subcommands

Functions

func Execute

func Execute()

Execute adds all child commands to the root command and sets flags appropriately. This is called by main.main(). It only needs to happen once to the rootCmd.

Types

This section is empty.

Jump to

Keyboard shortcuts

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