Skip to content

Add support for task options #110

Description

@lucas-bremond

Hi!

Before I start proposing a PR, I'd like to know whether you'd be open to the addition of a "task option" concept.

A couple of UX ideas:

# Leaner, but would require "reserved" option words (`tags`, `projects`, `paths`, ...) not to collide with Mani's own options
mani run <task> --tags <tag> --foo "abc" --bar

# Verbose (and kind of ugly), but allows for any option to be defined
mani run <task> --tags <tag> --option-foo "abc" --option-bar

# Perhaps a good-enough compromise to differentiate between Mani's options and task options?
mani run <task> --tags <tag> -- --foo "abc" --bar

And the configuration file could look like that:

tasks:
  commit-push:
    options:
      message:
        desc: Commit message.
        required: true
      push:
        desc: Push changes to the remote.
        type: bool
        default: false
    cmd: |
      git commit -m ${message}

      # The `push` option is injected as a variable, accessible as such
      if [ "${push}" = 1 ]; then
        git push
      fi

to be used as:

mani run commit-push --tags <tag> --message "add something cool" --push

Thoughts?

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions