Skip to content

Commit

Permalink
Wip: refactor repeated test command code.
Browse files Browse the repository at this point in the history
  • Loading branch information
[email protected] authored and chermehdi committed Mar 14, 2020
1 parent f724719 commit d55e9c1
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 185 deletions.
8 changes: 4 additions & 4 deletions commands/case.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ func writeLinesToFile(filename string, lines []string) error {
}

for _, line := range lines {
fmt.Fprintln(f, line)
_, err := fmt.Fprintln(f, line)
if err != nil {
return err
}
Expand Down Expand Up @@ -121,7 +121,7 @@ func CustomCaseAction(context *cli.Context) error {
}
}

metaData.SaveToFile(path.Join(cwd, configFileName))
err = metaData.SaveToFile(path.Join(cwd, configFileName))

if err != nil {
color.Red("Failed to save to MetaData")
Expand All @@ -141,8 +141,8 @@ func CustomCaseAction(context *cli.Context) error {
var CaseCommand = cli.Command{
Name: "case",
Aliases: []string{"tc", "testcase"},
Usage: "Create a custom test case.",
UsageText: "Add custom test cases to egor task.",
UsageText: "egor case <--no-output?>",
Usage: "Add custom test cases to egor task.",
Action: CustomCaseAction,
Flags: []cli.Flag{
&cli.BoolFlag{
Expand Down
2 changes: 1 addition & 1 deletion commands/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ var ConfigCommand = cli.Command{
Name: "config",
Aliases: []string{"c"},
Usage: "Read/Change global configuration parameters",
UsageText: "Read/Change global configuraiton parameters",
UsageText: "egor config set <config.name> <config.value> | egor config get <config.name?>",
Subcommands: []*cli.Command{
{
Name: "set",
Expand Down
4 changes: 2 additions & 2 deletions commands/parse.go
Original file line number Diff line number Diff line change
Expand Up @@ -185,7 +185,7 @@ func ParseAction(_ *cli.Context) error {
var ParseCommand = cli.Command{
Name: "parse",
Aliases: []string{"p"},
Usage: "Parse a task using 'Competitive Companion'",
UsageText: "parse task from navigator",
Usage: "parse task from navigator",
UsageText: "egor parse",
Action: ParseAction,
}
Loading

0 comments on commit d55e9c1

Please sign in to comment.