Skip to content

Commit ecc4b87

Browse files
committed
Merge branch 'rename-cli-docs-to-task'
2 parents 8e7f3cf + 7d32596 commit ecc4b87

File tree

2 files changed

+11
-11
lines changed

2 files changed

+11
-11
lines changed

cmd/codecrafters/main.go

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ EXAMPLES
3030
COMMANDS
3131
test: Run tests without committing changes
3232
submit: Commit changes & submit to move to next step
33-
docs: View current stage instructions
33+
task: View current stage instructions
3434
update-buildpack: Update language version
3535
help: Show usage instructions
3636
@@ -86,13 +86,13 @@ func run() error {
8686
return commands.TestCommand(ctx, *shouldTestPrevious)
8787
case "submit":
8888
return commands.SubmitCommand(ctx)
89-
case "docs":
90-
docsCmd := flag.NewFlagSet("docs", flag.ExitOnError)
91-
stageSlug := docsCmd.String("stage", "", "view instructions for a specific stage (slug, +N, or -N)")
92-
raw := docsCmd.Bool("raw", false, "print instructions without pretty-printing")
93-
docsCmd.Parse(flag.Args()[1:])
89+
case "task":
90+
taskCmd := flag.NewFlagSet("task", flag.ExitOnError)
91+
stageSlug := taskCmd.String("stage", "", "view instructions for a specific stage (slug, +N, or -N)")
92+
raw := taskCmd.Bool("raw", false, "print instructions without pretty-printing")
93+
taskCmd.Parse(flag.Args()[1:])
9494

95-
return commands.DocsCommand(ctx, *stageSlug, *raw)
95+
return commands.TaskCommand(ctx, *stageSlug, *raw)
9696
case "update-buildpack":
9797
return commands.UpdateBuildpackCommand(ctx)
9898
case "help",
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,12 +12,12 @@ import (
1212
"github.com/rs/zerolog"
1313
)
1414

15-
func DocsCommand(ctx context.Context, stageSlug string, raw bool) (err error) {
15+
func TaskCommand(ctx context.Context, stageSlug string, raw bool) (err error) {
1616
logger := zerolog.Ctx(ctx)
1717

18-
logger.Debug().Msg("docs command starts")
18+
logger.Debug().Msg("task command starts")
1919
defer func() {
20-
logger.Debug().Err(err).Msg("docs command ends")
20+
logger.Debug().Err(err).Msg("task command ends")
2121
}()
2222

2323
defer func() {
@@ -147,5 +147,5 @@ func buildStageError(message string, currentStageIndex int, stages []utils.Stage
147147
errorMsg += fmt.Sprintf("%s%d. [%s] %s%s\n", marker, i, stage.Slug, stage.Name, offsetStr)
148148
}
149149

150-
return fmt.Errorf(errorMsg)
150+
return fmt.Errorf("%s", errorMsg)
151151
}

0 commit comments

Comments
 (0)