Skip to content

Implement main file functionality #5

@yehorbk

Description

@yehorbk

Our application should have functionality for start up with arguments:

  • -e - expression
  • -f - input file (instead of expression)
  • -o - output file for result (if not set - pipe result to default stdout (console))

Usage example:

  • -e "5 5 +"
  • -f my-input.txt
  • -o result.txt
  • go run ./cmd/example -e “42 1 -” -o result.txt
  • go run ./cmd/example -f input.txt

Use flag library to parse command line arguments: https://pkg.go.dev/flag

Errors should be piped into stderr stream.
The input and output should be injected into ComputeHandler using Dependency Injection.

Metadata

Metadata

Assignees

Labels

featureNew feature or request

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions