Skip to content

Modify command execution to check for local context and use default value if defined 🧺 #4047

@Adam-it

Description

@Adam-it

🎯 Aim

The aim of this issue is to modify CLI command execution path to first check if there is any context file in the current path the user is in and if so check if any of the options defined in it may be used in order to populate the currently executed command. Full description with examples is added to the related issue.

Related issue

#3896

Spec

  • checks the current working directory for a context file
  • if context file found and parsing failed, throws an error and fails command execution
  • if no context file found or context file found but doesn't have any context values, executes command using arguments provided by the user
  • if context file found and parsed, reads values from options specified in the context
  • using information about the current command, builds an option object that contains only options defined in the command
  • merges the options object from the context with options specified by the user, where the options specified by the user override values from the context
  • validates provided options using command's validators and reports any issues
  • logs debug information about retrieving context and applying to command so that in case of an error we have sufficient information to debug what's causing the error

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions