Skip to content

[Feature] Add then block #799

@Ph0enixKM

Description

@Ph0enixKM

Is your feature request related to a problem? Please describe.
Complementary to existing failed and succeeded block, let's add then block that will run after certain command. This then block will carry status exit code within a parameter.

Describe the solution you'd like
Ability to simply

$ my command --flag $ then(arg) {
  echo "My command finished with {arg} exit code"
}

Rules:

  1. If function has then block, then no trust command modifier is required. This syntax means that the developer wants to handle the exit code by themselves.
  2. then is run no matter what function / command exit code is.
  3. Developer can NOT chain failed, succeeded and then blocks at the same time for a single failable expression
  4. When then is used without a variable name wrapped around parentheses, appropriate error is raised. There is no point of running this block in this case.

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions