mirror of
https://github.com/taigrr/wtf
synced 2025-01-18 04:03:14 -08:00
Add more 'man page' like functionality
This commit is contained in:
@@ -3,6 +3,7 @@ package git
|
||||
import (
|
||||
"github.com/olebedev/config"
|
||||
"github.com/wtfutil/wtf/cfg"
|
||||
"github.com/wtfutil/wtf/utils"
|
||||
)
|
||||
|
||||
const defaultTitle = "Git"
|
||||
@@ -10,10 +11,10 @@ const defaultTitle = "Git"
|
||||
type Settings struct {
|
||||
common *cfg.Common
|
||||
|
||||
commitCount int
|
||||
commitFormat string
|
||||
dateFormat string
|
||||
repositories []interface{}
|
||||
commitCount int `help:"The number of past commits to display." values:"A positive integer, 0..n."`
|
||||
commitFormat string `help:"The string format for the commit message." optional:"true"`
|
||||
dateFormat string `help:"The string format for the date/time in the commit message." optional:"true"`
|
||||
repositories []interface{} `help:"Defines which git repositories to watch." values:"A list of zero or more local file paths pointing to valid git repositories."`
|
||||
}
|
||||
|
||||
func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *config.Config) *Settings {
|
||||
@@ -29,3 +30,11 @@ func NewSettingsFromYAML(name string, ymlConfig *config.Config, globalConfig *co
|
||||
|
||||
return &settings
|
||||
}
|
||||
|
||||
func (widget *Widget) ConfigText() string {
|
||||
return utils.HelpFromInterface(Settings{})
|
||||
}
|
||||
|
||||
func (widget *Widget) HelpText() string {
|
||||
return widget.KeyboardWidget.HelpText()
|
||||
}
|
||||
|
||||
@@ -85,10 +85,6 @@ func (widget *Widget) Refresh() {
|
||||
widget.display()
|
||||
}
|
||||
|
||||
func (widget *Widget) HelpText() string {
|
||||
return widget.KeyboardWidget.HelpText()
|
||||
}
|
||||
|
||||
/* -------------------- Unexported Functions -------------------- */
|
||||
|
||||
func (widget *Widget) addCheckoutButton(form *tview.Form, fctn func()) {
|
||||
|
||||
Reference in New Issue
Block a user