Skip to content

feat: import CLI app from benchttp/engine#1

Merged
GregoryAlbouy merged 12 commits intomainfrom
feat/import-cli-from-benchttp-engine
Oct 8, 2022
Merged

feat: import CLI app from benchttp/engine#1
GregoryAlbouy merged 12 commits intomainfrom
feat/import-cli-from-benchttp-engine

Conversation

@GregoryAlbouy
Copy link
Member

@GregoryAlbouy GregoryAlbouy commented Oct 8, 2022

Description

Extract CLI app from benchttp/engine to make it a standalone repository.

Must be merged after the following PRs:

  1. chore: extract cli app engine#48
  2. refactor: config engine#26

Then we can delete the temporary commit which will fix the CI.

Changes

Notes

Some package renamings made sense:

- configparse -> configfile
- configflags -> configflag
- move runner.Report rendering from engine to cli
- gather rendering in new package internal/render
- move package ansi into internal/render
- fix flag -silent that was ignored
- always print test suite results, even if silent is enabled
- necessary step: separate summary and test suite resutlts outputs
- remove json/yaml parsing logics
- use engine/configparse instead
- use new method config.WithField
- apply inversion of Config.Override
- run go mod tidy
 - use -silent as a separate CLI-only flag (same as -configFile)
 - update tests & fixtures accordingly
 - update docs accordingly
@GregoryAlbouy GregoryAlbouy force-pushed the feat/import-cli-from-benchttp-engine branch from af8071a to 998bc77 Compare October 8, 2022 12:33
moreirathomas
moreirathomas previously approved these changes Oct 8, 2022
Copy link
Member

@moreirathomas moreirathomas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very very nice !

I did'nt test manually yet and will do, but it looks great !

}

func run() error {
commandName, nextArgs, err := shiftArgs(os.Args[1:])
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick :

Suggested change
commandName, nextArgs, err := shiftArgs(os.Args[1:])
command, options, err := shiftArgs(os.Args[1:])

to mirror the ofter used syntax

program-example [command] <options>

Copy link
Member Author

@GregoryAlbouy GregoryAlbouy Oct 8, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done, except for command that conflicts with type command interface below

@GregoryAlbouy GregoryAlbouy merged commit d5cb626 into main Oct 8, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants