-
Notifications
You must be signed in to change notification settings - Fork 71
/
typegen.go
50 lines (39 loc) · 3.98 KB
/
typegen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// Code generated by "core generate"; DO NOT EDIT.
package exec
import (
"io"
"cogentcore.org/core/types"
)
var _ = types.AddType(&types.Type{Name: "cogentcore.org/core/base/exec.Config", IDName: "config", Doc: "Config contains the configuration information that\ncontrols the behavior of exec. It is passed to most\nhigh-level functions, and a default version of it\ncan be easily constructed using [DefaultConfig].", Directives: []types.Directive{{Tool: "types", Directive: "add", Args: []string{"-setters"}}}, Fields: []types.Field{{Name: "Buffer", Doc: "Buffer is whether to buffer the output of Stdout and Stderr,\nwhich is necessary for the correct printing of commands and output\nwhen there is an error with a command, and for correct coloring\non Windows. Therefore, it should be kept at the default value of\ntrue in most cases, except for when a command will run for a log\ntime and print output throughout (eg: a log command)."}, {Name: "PrintOnly", Doc: "PrintOnly is whether to only print commands that would be run and\nnot actually run them. It can be used, for example, for safely testing\nan app."}, {Name: "Dir", Doc: "The directory to execute commands in. If it is unset,\ncommands are run in the current directory."}, {Name: "Env", Doc: "Env contains any additional environment variables specified.\nThe current environment variables will also be passed to the\ncommand, but they will be overridden by any variables here\nif there are conflicts."}, {Name: "Stdout", Doc: "Stdout is the writer to write the standard output of called commands to.\nIt can be set to nil to disable the writing of the standard output."}, {Name: "Stderr", Doc: "Stderr is the writer to write the standard error of called commands to.\nIt can be set to nil to disable the writing of the standard error."}, {Name: "Stdin", Doc: "Stdin is the reader to use as the standard input."}, {Name: "Commands", Doc: "Commands is the writer to write the string representation of the called commands to.\nIt can be set to nil to disable the writing of the string representations of the called commands."}}})
// SetBuffer sets the [Config.Buffer]:
// Buffer is whether to buffer the output of Stdout and Stderr,
// which is necessary for the correct printing of commands and output
// when there is an error with a command, and for correct coloring
// on Windows. Therefore, it should be kept at the default value of
// true in most cases, except for when a command will run for a log
// time and print output throughout (eg: a log command).
func (t *Config) SetBuffer(v bool) *Config { t.Buffer = v; return t }
// SetPrintOnly sets the [Config.PrintOnly]:
// PrintOnly is whether to only print commands that would be run and
// not actually run them. It can be used, for example, for safely testing
// an app.
func (t *Config) SetPrintOnly(v bool) *Config { t.PrintOnly = v; return t }
// SetDir sets the [Config.Dir]:
// The directory to execute commands in. If it is unset,
// commands are run in the current directory.
func (t *Config) SetDir(v string) *Config { t.Dir = v; return t }
// SetStdout sets the [Config.Stdout]:
// Stdout is the writer to write the standard output of called commands to.
// It can be set to nil to disable the writing of the standard output.
func (t *Config) SetStdout(v io.Writer) *Config { t.Stdout = v; return t }
// SetStderr sets the [Config.Stderr]:
// Stderr is the writer to write the standard error of called commands to.
// It can be set to nil to disable the writing of the standard error.
func (t *Config) SetStderr(v io.Writer) *Config { t.Stderr = v; return t }
// SetStdin sets the [Config.Stdin]:
// Stdin is the reader to use as the standard input.
func (t *Config) SetStdin(v io.Reader) *Config { t.Stdin = v; return t }
// SetCommands sets the [Config.Commands]:
// Commands is the writer to write the string representation of the called commands to.
// It can be set to nil to disable the writing of the string representations of the called commands.
func (t *Config) SetCommands(v io.Writer) *Config { t.Commands = v; return t }