Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Task descriptions #62

Closed
reggi opened this issue May 21, 2019 · 3 comments
Closed

Feature Request: Task descriptions #62

reggi opened this issue May 21, 2019 · 3 comments
Labels
enhancement New feature or request

Comments

@reggi
Copy link

reggi commented May 21, 2019

I'd love to see descriptions in the oya tasks command of what a task is.

Project: Example

descriptions: 
  meow: 'Say Meow'

meow: | 
    echo 'meow'

Then:

➜  oya-test oya tasks
oya run meow .......................... Say Meow    

It would be nice to have descriptions and arguments.

@reggi
Copy link
Author

reggi commented May 21, 2019

Here's an alternative idea, if a command is an object allow specific properties:

company.build-prod:
  description: Build production
  command: |
    docker-compose exec api yarn run tsc --pretty --project tsconfig.production.json

company.single-test: 
  description: Run a single test
  args: 
    file: 
      type: FILE
  command: |
    docker-compose exec api yarn test-pattern ${file}

@bilus
Copy link
Contributor

bilus commented May 26, 2019

@reggi Thanks for the suggestions!

As far as descriptions, it's already implemented (just not documented yet, sorry) using task meta-information syntax (<task-name>.<meta-key>):

Project: aaa

build.Doc: Builds the system
build: |
  ./build
$ oya tasks
# in ./Oyafile
oya run anotherTask
oya run build        # Builds the system

In general, we have ideas for more of these extensions (including declarative argument checking and task dependencies).

As far as arguments, while there's no way to validate them (yet), there are ways you can access them beyond what bash supports ($@, $1, etc.):

Project: foo

build.Doc: Builds the system
build: |
  echo build ${Oya[Args.0]} ${Oya[Flags.all]} ${Oya[Flags.target]}
$ oya run build file.txt --all --target=ababa
build file.txt true ababa

Notice the ${Oya[xxx]} syntax. Oya uses associative arrays in bash scripts to make it both compatible with regular bash 4 scripts & to avoid conflicts with existing env variables.

@bilus bilus added the enhancement New feature or request label May 26, 2019
@bilus
Copy link
Contributor

bilus commented Jun 6, 2019

We need to document this. Created #67 to address it. I'm closing this issue but if anybody feels it should be reopen, please feel free to do so.

@bilus bilus closed this as completed Jun 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants