Commit graph

2 commits

Author SHA1 Message Date
e898a1ded5
fix: fixed error when using --help flag
All checks were successful
REUSE Compliance Check / check (push) Successful in 8s
Parse the flags before loading the configuration to fix the error where
using the --help flag caused the app to return an error if the
configuration file does not exist.
2024-08-23 02:47:36 +01:00
89e53bcc9f
refactor: update the executor lookup table
All checks were successful
Tests / test (pull_request) Successful in 16s
REUSE Compliance Check / check (push) Successful in 6s
Updated the executor lookup table by changing the map type from
map[string]Executor to map[string]func(string, bool, []string) error in
order to reduce the cost of initialising the map.

Previously the map initialised all the executors despite only needing
to run the single executor called by the command. The map now instead
maps the command to the function of type
'func(string, bool, []string) error' that will initialise and run the
executor called by the command. As a result of the change, the
Executor interface is no longer needed and has been removed.

PR: #57
2024-08-21 18:44:04 +01:00