Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var Remote = app.Register(&app.Command[app.Empty, app.Empty]{ Use: "remote {remote}", Desc: "Edit remote file", Action: "Edit", PrepareNoFlag: func(cmd *cobra.Command) { cmd.Args = cobra.ExactArgs(1) cmd.ValidArgsFunction = app.Comp(app.CompRemote) }, Run: func(ctx *app.Context[app.Empty, app.Empty]) error { name := fmt.Sprintf("%s.toml", ctx.Arg(0)) path := config.GetDir("remotes", name) return app.Edit(path, config.DefaultRemote, name, func(s string) error { data := []byte(s) var remote core.Remote err := toml.Unmarshal(data, &remote) if err != nil { return errors.Trace(err, "parse toml") } err = validate.Do(&remote) return errors.Trace(err, "validate fields") }) }, })
Functions ¶
This section is empty.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.