Skip to content

Commit 0c61715

Browse files
committed
Rename -only-compose and -only-generate to -compose and -render
1 parent ac0b259 commit 0c61715

File tree

4 files changed

+16
-16
lines changed

4 files changed

+16
-16
lines changed

README.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,10 +37,10 @@ Usage of monako:
3737
Fail on document conversion errors
3838
-menu-config string
3939
Menu file for monako-book theme (default "config.menu.md")
40-
-only-compose
40+
-compose
4141
Only compose the Monako structure
42-
-only-generate
43-
Only generate HTML files from an existing Monako structure
42+
-render
43+
Only render HTML files from an existing Monako structure
4444
-trace
4545
Enable trace logging
4646
```

cmd/monako/main.go

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -25,15 +25,15 @@ func parseCommandLine() (cliSettings compose.CommandLineSettings) {
2525
var trace = f.Bool("trace", false, "Enable trace logging")
2626
var showVersion = f.Bool("version", false, "Show version")
2727
var failOnHugoError = f.Bool("fail-on-error", false, "Fail on document conversion errors")
28-
var onlyCompose = f.Bool("only-compose", false, "Only compose the Monako structure")
29-
var onlyGenerate = f.Bool("only-generate", false, "Only generate HTML files from an existing Monako structure")
28+
var onlyCompose = f.Bool("compose", false, "Only compose the Monako structure")
29+
var onlyRender = f.Bool("render", false, "Only render HTML files from an existing Monako structure")
3030

3131
err := f.Parse(os.Args[1:])
3232
if err != nil {
3333
log.Fatal("Can't parse arguments")
3434
}
35-
if *onlyCompose && *onlyGenerate {
36-
log.Fatal("only-compose and only-generate can't be set both")
35+
if *onlyCompose && *onlyRender {
36+
log.Fatal("compose and render can't be set both")
3737
}
3838

3939
return compose.CommandLineSettings{
@@ -45,7 +45,7 @@ func parseCommandLine() (cliSettings compose.CommandLineSettings) {
4545
ShowVersion: *showVersion,
4646
FailOnHugoError: *failOnHugoError,
4747
OnlyCompose: *onlyCompose,
48-
OnlyGenerate: *onlyGenerate,
48+
OnlyRender: *onlyRender,
4949
}
5050
}
5151

@@ -73,7 +73,7 @@ func main() {
7373
}
7474

7575
config := compose.Init(cliSettings)
76-
if !cliSettings.OnlyGenerate {
76+
if !cliSettings.OnlyRender {
7777
err := config.Compose()
7878
if err != nil {
7979
log.Fatal(err)

cmd/monako/main_test.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ func TestMainSplitCalls(t *testing.T) {
182182

183183
os.Args = []string{
184184
"monako",
185-
"-only-compose",
185+
"-compose",
186186
"-fail-on-error",
187187
"-working-dir", targetDir,
188188
"-config", monakoConfig,
@@ -195,7 +195,7 @@ func TestMainSplitCalls(t *testing.T) {
195195

196196
os.Args = []string{
197197
"monako",
198-
"-only-generate",
198+
"-render",
199199
"-fail-on-error",
200200
"-working-dir", targetDir,
201201
"-config", monakoConfig,
@@ -215,7 +215,7 @@ func TestFailOnNoComposeBeforeGenerate(t *testing.T) {
215215
monakoConfig, menuConfig := writeConfig("https://github.com/snipem/monako-test.git")
216216
os.Args = []string{
217217
"monako",
218-
"-only-generate",
218+
"-render",
219219
"-fail-on-error",
220220
"-working-dir", targetDir,
221221
"-config", monakoConfig,

pkg/compose/config.go

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,8 +49,8 @@ type CommandLineSettings struct {
4949
FailOnHugoError bool
5050
// OnlyCompose will only compose files but not generate HTML
5151
OnlyCompose bool
52-
// OnlyGenerate will only generate HTML files but not compose them
53-
OnlyGenerate bool
52+
// OnlyRender will only render HTML files but not compose them
53+
OnlyRender bool
5454
}
5555

5656
// LoadConfig returns the Monako config from the given configfilepath
@@ -180,7 +180,7 @@ func Init(cliSettings CommandLineSettings) (config *Config) {
180180
}
181181
}
182182

183-
if !cliSettings.OnlyGenerate {
183+
if !cliSettings.OnlyRender {
184184
// Dont do these steps if only generate
185185
config.CleanUp()
186186

@@ -198,7 +198,7 @@ func Init(cliSettings CommandLineSettings) (config *Config) {
198198
func (config *Config) Generate() error {
199199

200200
if _, err := os.Stat(config.HugoWorkingDir); os.IsNotExist(err) {
201-
log.Fatalf("%s does not exist, run monako only-generate before?", config.HugoWorkingDir)
201+
log.Fatalf("%s does not exist, run monako -render before?", config.HugoWorkingDir)
202202
}
203203

204204
err := helpers.HugoRun([]string{"--source", config.HugoWorkingDir})

0 commit comments

Comments
 (0)