Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var RootCmd = &cobra.Command{ Use: "duden", Short: "Command line interface to http://www.duden.de", RunE: func(cmd *cobra.Command, args []string) error { if len(args) < 1 { cmd.Help() os.Exit(1) } word := strings.Join(args, " ") opt := duden.Options{ Timeout: timeout, FollowPages: followPages, } if noColors { color.NoColor = true } d, err := duden.Search(word, opt) if err != nil { return err } if all { for _, r := range d.GetResults() { fmt.Printf(":: %s: %s\n", color.YellowString(r.Word), r.Definition) } } else { r, err := d.GetResult(pos) if err != nil { return err } fmt.Printf(":: %s: %s\n", color.YellowString(r.Word), r.Definition) } return nil }, }
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.