@@ -23,8 +23,8 @@ const (
23
23
24
24
// Config is the main configuration structure for Air.
25
25
type Config struct {
26
- Root string `toml:"root"`
27
- TmpDir string `toml:"tmp_dir"`
26
+ Root string `toml:"root" usage:"Working directory, . or absolute path, please note that the directories following must be under root" `
27
+ TmpDir string `toml:"tmp_dir" usage:"Temporary directory for air" `
28
28
TestDataDir string `toml:"testdata_dir"`
29
29
Build cfgBuild `toml:"build"`
30
30
Color cfgColor `toml:"color"`
@@ -35,29 +35,29 @@ type Config struct {
35
35
}
36
36
37
37
type cfgBuild struct {
38
- PreCmd []string `toml:"pre_cmd"`
39
- Cmd string `toml:"cmd"`
40
- PostCmd []string `toml:"post_cmd"`
41
- Bin string `toml:"bin"`
42
- FullBin string `toml:"full_bin"`
43
- ArgsBin []string `toml:"args_bin"`
44
- Log string `toml:"log"`
45
- IncludeExt []string `toml:"include_ext"`
46
- ExcludeDir []string `toml:"exclude_dir"`
47
- IncludeDir []string `toml:"include_dir"`
48
- ExcludeFile []string `toml:"exclude_file"`
49
- IncludeFile []string `toml:"include_file"`
50
- ExcludeRegex []string `toml:"exclude_regex"`
51
- ExcludeUnchanged bool `toml:"exclude_unchanged"`
52
- FollowSymlink bool `toml:"follow_symlink"`
53
- Poll bool `toml:"poll"`
54
- PollInterval int `toml:"poll_interval"`
55
- Delay int `toml:"delay"`
56
- StopOnError bool `toml:"stop_on_error"`
57
- SendInterrupt bool `toml:"send_interrupt"`
58
- KillDelay time.Duration `toml:"kill_delay"`
59
- Rerun bool `toml:"rerun"`
60
- RerunDelay int `toml:"rerun_delay"`
38
+ PreCmd []string `toml:"pre_cmd" usage:"Array of commands to run before each build" `
39
+ Cmd string `toml:"cmd" usage:"Just plain old shell command. You could use 'make' as well" `
40
+ PostCmd []string `toml:"post_cmd" usage:"Array of commands to run after ^C" `
41
+ Bin string `toml:"bin" usage:"Binary file yields from 'cmd'" `
42
+ FullBin string `toml:"full_bin" usage:"Customize binary, can setup environment variables when run your app" `
43
+ ArgsBin []string `toml:"args_bin" usage:"Add additional arguments when running binary (bin/full_bin)." `
44
+ Log string `toml:"log" usage:"This log file is placed in your tmp_dir" `
45
+ IncludeExt []string `toml:"include_ext" usage:"Watch these filename extensions" `
46
+ ExcludeDir []string `toml:"exclude_dir" usage:"Ignore these filename extensions or directories" `
47
+ IncludeDir []string `toml:"include_dir" usage:"Watch these directories if you specified" `
48
+ ExcludeFile []string `toml:"exclude_file" usage:"Exclude files" `
49
+ IncludeFile []string `toml:"include_file" usage:"Watch these files" `
50
+ ExcludeRegex []string `toml:"exclude_regex" usage:"Exclude specific regular expressions" `
51
+ ExcludeUnchanged bool `toml:"exclude_unchanged" usage:"Exclude unchanged files" `
52
+ FollowSymlink bool `toml:"follow_symlink" usage:"Follow symlink for directories" `
53
+ Poll bool `toml:"poll" usage:"Poll files for changes instead of using fsnotify" `
54
+ PollInterval int `toml:"poll_interval" usage:"Poll interval (defaults to the minimum interval of 500ms)" `
55
+ Delay int `toml:"delay" usage:"It's not necessary to trigger build each time file changes if it's too frequent" `
56
+ StopOnError bool `toml:"stop_on_error" usage:"Stop running old binary when build errors occur" `
57
+ SendInterrupt bool `toml:"send_interrupt" usage:"Send Interrupt signal before killing process (windows does not support this feature)" `
58
+ KillDelay time.Duration `toml:"kill_delay" usage:"Delay after sending Interrupt signal" `
59
+ Rerun bool `toml:"rerun" usage:"Rerun binary or not" `
60
+ RerunDelay int `toml:"rerun_delay" usage:"Delay after each execution" `
61
61
regexCompiled []* regexp.Regexp
62
62
}
63
63
@@ -66,32 +66,32 @@ func (c *cfgBuild) RegexCompiled() ([]*regexp.Regexp, error) {
66
66
}
67
67
68
68
type cfgLog struct {
69
- AddTime bool `toml:"time"`
70
- MainOnly bool `toml:"main_only"`
71
- Silent bool `toml:"silent"`
69
+ AddTime bool `toml:"time" usage:"Show log time" `
70
+ MainOnly bool `toml:"main_only" usage:"Only show main log (silences watcher, build, runner)" `
71
+ Silent bool `toml:"silent" usage:"silence all logs produced by air" `
72
72
}
73
73
74
74
type cfgColor struct {
75
- Main string `toml:"main"`
76
- Watcher string `toml:"watcher"`
77
- Build string `toml:"build"`
78
- Runner string `toml:"runner"`
75
+ Main string `toml:"main" usage:"Customize main part's color. If no color found, use the raw app log" `
76
+ Watcher string `toml:"watcher" usage:"Customize watcher part's color" `
77
+ Build string `toml:"build" usage:"Customize build part's color" `
78
+ Runner string `toml:"runner" usage:"Customize runner part's color" `
79
79
App string `toml:"app"`
80
80
}
81
81
82
82
type cfgMisc struct {
83
- CleanOnExit bool `toml:"clean_on_exit"`
83
+ CleanOnExit bool `toml:"clean_on_exit" usage:"Delete tmp directory on exit" `
84
84
}
85
85
86
86
type cfgScreen struct {
87
- ClearOnRebuild bool `toml:"clear_on_rebuild"`
88
- KeepScroll bool `toml:"keep_scroll"`
87
+ ClearOnRebuild bool `toml:"clear_on_rebuild" usage:"Clear screen on rebuild" `
88
+ KeepScroll bool `toml:"keep_scroll" usage:"Keep scroll position after rebuild" `
89
89
}
90
90
91
91
type cfgProxy struct {
92
- Enabled bool `toml:"enabled"`
93
- ProxyPort int `toml:"proxy_port"`
94
- AppPort int `toml:"app_port"`
92
+ Enabled bool `toml:"enabled" usage:"Enable live-reloading on the browser" `
93
+ ProxyPort int `toml:"proxy_port" usage:"Port for proxy server" `
94
+ AppPort int `toml:"app_port" usage:"Port for your app" `
95
95
}
96
96
97
97
type sliceTransformer struct {}
0 commit comments