Documentation ¶
Index ¶
- Constants
- Variables
- func CreateRun(module string) (err error)
- func FeedbackRun(args []string) (err error)
- func FlowRun(entrypoints []string) (err error)
- func FmtRun(files []string) (err error)
- func GenRun(args []string) (err error)
- func InstallUpdate() (err error)
- func ModPersistentPreRun(args []string) (err error)
- func PrintUpdateAvailable()
- func RootInit()
- func RootPersistentPostRun(args []string) (err error)
- func RootPersistentPreRun(args []string) (err error)
- func RunErr() error
- func RunExit()
- func RunInt() int
- func RunRun(args []string) (err error)
- func WaitPrintUpdateAvailable()
- type ProgramVersion
Constants ¶
View Source
const RootCustomHelp = `` /* 999-byte string literal not displayed */
Variables ¶
View Source
var ( UpdateCheckFlag bool UpdateVersionFlag string UpdateStarted bool UpdateErrored bool UpdateChecked bool UpdateAvailable *ProgramVersion UpdateData []interface{} )
View Source
var BashCompletionCmd = &cobra.Command{ Use: "bash", Short: "Generate Bash completions", Long: BashCompletionLong, Run: func(cmd *cobra.Command, args []string) { RootCmd.GenBashCompletionV2(os.Stdout, false) }, }
View Source
var BashCompletionLong = `` /* 214-byte string literal not displayed */
View Source
var CompletionCmd = &cobra.Command{ Use: "completion", Aliases: []string{"completions"}, Short: "Generate completion helpers for popular terminals", Long: "Generate completion helpers for popular terminals", }
View Source
var (
CompletionVanillaFlag bool
)
View Source
var CreateCmd = &cobra.Command{ Use: "create <module location>", Short: "easily bootstrap full project, components, and more", Long: createLong, PreRun: func(cmd *cobra.Command, args []string) { ga.SendCommandPath(cmd.CommandPath()) }, Run: func(cmd *cobra.Command, args []string) { var err error var module string if 0 < len(args) { module = args[0] } err = CreateRun(module) if err != nil { fmt.Println(err) os.Exit(1) } }, }
View Source
var DatamodelCmd = &cobra.Command{ Use: "datamodel", Aliases: []string{ "dm", }, Short: "manage, diff, and migrate your data models", Long: datamodelLong, PreRun: func(cmd *cobra.Command, args []string) { ga.SendCommandPath(cmd.CommandPath()) }, }
View Source
var FeedbackCmd = &cobra.Command{ Use: "feedback [email] <message>", Aliases: []string{ "hi", "say", "from", "bug", "yo", "hello", "greetings", "support", }, Short: "send feedback, bug reports, or any message", Long: feedbackLong, PreRun: func(cmd *cobra.Command, args []string) { ga.SendCommandPath(cmd.CommandPath()) }, Run: func(cmd *cobra.Command, args []string) { var err error err = FeedbackRun(args) if err != nil { fmt.Println(err) os.Exit(1) } }, }
View Source
var FishCompletionCmd = &cobra.Command{ Use: "fish", Short: "Generate Fish completions", Long: "Generate Fish completions", Run: func(cmd *cobra.Command, args []string) { RootCmd.GenFishCompletion(os.Stdout, true) }, }
View Source
var FlowCmd = &cobra.Command{ Use: "flow [cue files...] [@flow/name...] [+key=value]", Aliases: []string{ "f", }, Short: "run CUE pipelines with the hof/flow DAG engine", Long: flowLong, PreRun: func(cmd *cobra.Command, args []string) { ga.SendCommandPath(cmd.CommandPath()) }, Run: func(cmd *cobra.Command, args []string) { var err error var globs []string if 0 < len(args) { globs = args[0:] } err = FlowRun(globs) if err != nil { fmt.Println(err) os.Exit(1) } }, }
View Source
var FmtCmd = &cobra.Command{ Use: "fmt [filepaths or globs]", Short: "format any code and manage the formatters", Long: fmtLong, ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) { glob := toComplete + "*" matches, _ := filepath.Glob(glob) return matches, cobra.ShellCompDirectiveDefault }, PreRun: func(cmd *cobra.Command, args []string) { ga.SendCommandPath(cmd.CommandPath()) }, Run: func(cmd *cobra.Command, args []string) { var err error if 0 >= len(args) { fmt.Println("missing required argument: 'files'") cmd.Usage() os.Exit(1) } var files []string if 0 < len(args) { files = args[0:] } err = FmtRun(files) if err != nil { fmt.Println(err) os.Exit(1) } }, }
View Source
var GenCmd = &cobra.Command{ Use: "gen [files...]", Aliases: []string{ "G", }, Short: "modular and composable code gen: CUE & data + templates = _", Long: genLong, PreRun: func(cmd *cobra.Command, args []string) { extra := " " if len(flags.GenFlags.Template) == 0 { extra = extra + "module" } else { extra = extra + "adhoc" } if flags.GenFlags.Watch || len(flags.GenFlags.WatchFull) > 0 || len(flags.GenFlags.WatchFull) > 0 { extra = extra + " watch" } ga.SendCommandPath(cmd.CommandPath() + extra) }, Run: func(cmd *cobra.Command, args []string) { var err error err = GenRun(args) if err != nil { fmt.Println(err) os.Exit(1) } }, }
View Source
var ModCmd = &cobra.Command{ Use: "mod", Aliases: []string{ "m", }, Short: "polyglot dependency management based on go mods and MVS", Long: modLong, PersistentPreRun: func(cmd *cobra.Command, args []string) { var err error err = ModPersistentPreRun(args) if err != nil { fmt.Println(err) os.Exit(1) } }, PreRun: func(cmd *cobra.Command, args []string) { ga.SendCommandPath(cmd.CommandPath()) }, }
View Source
var PowerShellCompletionCmd = &cobra.Command{ Use: "power-shell", Aliases: []string{"windows", "win", "power", "ps"}, Short: "Generate PowerShell completions", Long: "Generate PowerShell completions", Run: func(cmd *cobra.Command, args []string) { RootCmd.GenPowerShellCompletion(os.Stdout) }, }
View Source
var RootCmd = &cobra.Command{ Use: "hof", Short: "The High Code Framework", Long: hofLong, PersistentPreRun: func(cmd *cobra.Command, args []string) { var err error err = RootPersistentPreRun(args) if err != nil { fmt.Println(err) os.Exit(1) } }, PreRun: func(cmd *cobra.Command, args []string) { fmt.Println("root prerun") ga.SendCommandPath("root") }, PersistentPostRun: func(cmd *cobra.Command, args []string) { var err error err = RootPersistentPostRun(args) if err != nil { fmt.Println(err) os.Exit(1) } }, }
View Source
var RunCmd = &cobra.Command{ Use: "run", Aliases: []string{ "r", }, Short: "Hof Line Script (HLS) is a successor to bash and python based scripting", Long: runLong, PreRun: func(cmd *cobra.Command, args []string) { ga.SendCommandPath(cmd.CommandPath()) }, Run: func(cmd *cobra.Command, args []string) { var err error err = RunRun(args) if err != nil { fmt.Println(err) os.Exit(1) } }, }
View Source
var UpdateCmd = &cobra.Command{ Use: "update", Short: "update the hof tool", Long: UpdateLong, PreRun: func(cmd *cobra.Command, args []string) { ga.SendCommandPath("update") }, Run: func(cmd *cobra.Command, args []string) { latest, err := CheckUpdate(true) if err != nil { fmt.Println(err) os.Exit(-1) } cur := ProgramVersion{Version: "v" + verinfo.Version} if latest.Version == cur.Version || (UpdateVersionFlag == "" && cur.Version == "vLocal") { return } else { if UpdateCheckFlag { PrintUpdateAvailable() return } } err = InstallUpdate() if err != nil { fmt.Println(err) os.Exit(-1) } }, }
View Source
var UpdateLong = `Print the build version for hof`
View Source
var VersionCmd = &cobra.Command{ Use: "version", Aliases: []string{ "ver", }, Short: "print the version", Long: VersionLong, Run: func(cmd *cobra.Command, args []string) { s, e := os.UserConfigDir() fmt.Printf("hof ConfigDir %q %v\n", filepath.Join(s, "hof"), e) fmt.Printf( versionMessage, verinfo.Version, verinfo.Commit, verinfo.BuildDate, verinfo.GoVersion, verinfo.BuildOS, verinfo.BuildArch, ) }, }
View Source
var VersionLong = `Print the build version for hof`
Functions ¶
func FeedbackRun ¶ added in v0.5.1
func InstallUpdate ¶ added in v0.4.6
func InstallUpdate() (err error)
func ModPersistentPreRun ¶ added in v0.4.8
func PrintUpdateAvailable ¶ added in v0.4.4
func PrintUpdateAvailable()
func RootPersistentPostRun ¶ added in v0.4.6
func RootPersistentPreRun ¶
func WaitPrintUpdateAvailable ¶ added in v0.4.7
func WaitPrintUpdateAvailable()
Types ¶
type ProgramVersion ¶ added in v0.4.4
func CheckUpdate ¶ added in v0.4.4
func CheckUpdate(manual bool) (ver ProgramVersion, err error)
Source Files ¶
Click to show internal directories.
Click to hide internal directories.