Skip to content

Commit

Permalink
add docs for exported types
Browse files Browse the repository at this point in the history
  • Loading branch information
weynsee committed May 19, 2015
1 parent 0be6d35 commit 65b3276
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 0 deletions.
4 changes: 4 additions & 0 deletions cli/init_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import (
"strings"
)

// InitCommand will initialize a PhraseApp config file named .phrase in the current directory.
type InitCommand struct {
Ui mcli.Ui
Config *Config
API *phrase.Client
}

// Run executes the init command.
func (c *InitCommand) Run(args []string) int {
cmdFlags := flag.NewFlagSet("init", flag.ContinueOnError)
cmdFlags.Usage = func() { c.Ui.Output(c.Help()) }
Expand Down Expand Up @@ -55,6 +57,7 @@ func (c *InitCommand) Run(args []string) int {
return 0
}

// Help displays available options for the init command.
func (c *InitCommand) Help() string {
helpText := `
Usage: phrase init [options]
Expand All @@ -76,6 +79,7 @@ func (c *InitCommand) Help() string {
return strings.TrimSpace(helpText)
}

// Synopsis displays a synopsis of the init command.
func (c *InitCommand) Synopsis() string {
return "Initializes a phrase project"
}
4 changes: 4 additions & 0 deletions cli/pull_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ import (
"time"
)

// PullCommand will download locale files from PhraseApp.
type PullCommand struct {
Ui mcli.Ui
Config *Config
Expand All @@ -24,6 +25,7 @@ const (
defaultDownloadFormat = "yml"
)

// Run executes the pull command.
func (c *PullCommand) Run(args []string) int {
cmdFlags := flag.NewFlagSet("pull", flag.ContinueOnError)
cmdFlags.Usage = func() { c.Ui.Output(c.Help()) }
Expand Down Expand Up @@ -162,6 +164,7 @@ func (c *PullCommand) selectLocales(locales []string) ([]phrase.Locale, error) {
}
}

// Help displays available options for the pull command.
func (c *PullCommand) Help() string {
helpText := `
Usage: phrase pull [options] [LOCALE]
Expand All @@ -183,6 +186,7 @@ func (c *PullCommand) Help() string {
return strings.TrimSpace(helpText)
}

// Synopsis displays a synopsis of the pull command.
func (c *PullCommand) Synopsis() string {
return "Download the translation files in the current project"
}
4 changes: 4 additions & 0 deletions cli/push_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@ import (
"sync"
)

// PullCommand will upload locale files to PhraseApp.
type PushCommand struct {
Ui mcli.Ui
Config *Config
Expand All @@ -24,6 +25,7 @@ var defaultLocaleFolder = filepath.Join("config", "locales")

var validTag = regexp.MustCompile(`\A[a-zA-Z0-9\_\-\.]+\z`)

// Run executes the push command.
func (c *PushCommand) Run(args []string) int {
cmdFlags := flag.NewFlagSet("push", flag.ContinueOnError)
cmdFlags.Usage = func() { c.Ui.Output(c.Help()) }
Expand Down Expand Up @@ -224,6 +226,7 @@ func listFiles(dir string, list []string, recurse bool) []string {
return list
}

// Help displays available options for the push command.
func (c *PushCommand) Help() string {
helpText := `
Usage: phrase push [options] [FILE|DIRECTORY]
Expand All @@ -245,6 +248,7 @@ func (c *PushCommand) Help() string {
return strings.TrimSpace(helpText)
}

// Synopsis displays a synopsis of the push command.
func (c *PushCommand) Synopsis() string {
return "Upload the translation files in the current project to PhraseApp"
}
4 changes: 4 additions & 0 deletions cli/tags_command.go
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@ import (
"strings"
)

// TagsCommand will display all tags in the current project.
type TagsCommand struct {
Ui mcli.Ui
Config *Config
API *phrase.Client
}

// Run executes the tags command.
func (c *TagsCommand) Run(args []string) int {
list := false
cmdFlags := flag.NewFlagSet("tags", flag.ContinueOnError)
Expand All @@ -35,6 +37,7 @@ func (c *TagsCommand) Run(args []string) int {
return 0
}

// Help displays available options for the tags command.
func (c *TagsCommand) Help() string {
helpText := `
Usage: phrase tags [options]
Expand All @@ -49,6 +52,7 @@ func (c *TagsCommand) Help() string {
return strings.TrimSpace(helpText)
}

// Synopsis displays a synopsis of the tags command.
func (c *TagsCommand) Synopsis() string {
return "List all the tags in the current project"
}

0 comments on commit 65b3276

Please sign in to comment.