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

add basic task autocompletion #107

Closed
wants to merge 2 commits into from

Conversation

PhilippRosenkranz
Copy link

This adds basic task auto completion. I also added some simple auto completion scripts for
bash and fish.

If I find the time I will follow this up with a PR which adds auto complete for arguments as well.

This should resolve #103 (at least partially).

@PhilippRosenkranz PhilippRosenkranz self-assigned this Jun 21, 2018
@CLAassistant
Copy link

CLAassistant commented Jun 21, 2018

CLA assistant check
All committers have signed the CLA.

@rdsubhas
Copy link
Member

Hi @PhilippRosenkranz thanks so much :) Will check this out and merge asap...

@rdsubhas
Copy link
Member

rdsubhas commented Jun 21, 2018

Hi @PhilippRosenkranz went through the PR 👍

We also have an issue / feature request: #97

Verbose task list with descriptions
Now, the task list is a table. Allow a verbose task list option, which will print tasks with full details including the description.

The ListFullTaskNames looks very close to solving this. Every command line option we add, we tend to see more as a contract that would be frozen after release (changing it would mean major version), and we don't have as much flexibility in any changes after releasing. If we use myke --tasks with a specific grep syntax, then that would be frozen, and then that could block the other issue (verbose task list)...

Is there any way we can pretty print the tasks output, and kill both issues with one stone? 😄 Basically a pretty output with description which is human readable, and from which the task names can also be grepped for completion? 😄

@PhilippRosenkranz
Copy link
Author

PhilippRosenkranz commented Jun 29, 2018

Hi @rdsubhas,

I've tried to implement/fix #97 as best as I could as part of this PR.

Each output line is now a tab delimited list of:

  • full task name (i.e. project name/task name)
  • tags (if any)
  • description
  • myke file in which this task is defined

Example output:

env/file_custom                 /home/phiros/dev/leanovate/cl/myke/examples/env/myke.yml
env/file_custom_local                   /home/phiros/dev/leanovate/cl/myke/examples/env/myke.yml
env/file_default                        /home/phiros/dev/leanovate/cl/myke/examples/env/myke.yml
env/file_default_local                  /home/phiros/dev/leanovate/cl/myke/examples/env/myke.yml
env/path                        /home/phiros/dev/leanovate/cl/myke/examples/env/myke.yml
env/yml                 /home/phiros/dev/leanovate/cl/myke/examples/env/myke.yml
hooks/after                     /home/phiros/dev/leanovate/cl/myke/examples/hooks/myke.yml
hooks/before                    /home/phiros/dev/leanovate/cl/myke/examples/hooks/myke.yml
hooks/error                     /home/phiros/dev/leanovate/cl/myke/examples/hooks/myke.yml
mixin/path                      /home/phiros/dev/leanovate/cl/myke/examples/mixin/myke.yml
mixin/task1                     /home/phiros/dev/leanovate/cl/myke/examples/mixin/myke.yml
mixin/task2                     /home/phiros/dev/leanovate/cl/myke/examples/mixin/myke.yml
mixin/task3                     /home/phiros/dev/leanovate/cl/myke/examples/mixin/myke.yml
retry/retry                     /home/phiros/dev/leanovate/cl/myke/examples/retry/myke.yml
tags1/tag       tagA,tagB       run as myke tag (or) tags1/tag (or) tagA/tag (or) tagB/tag      /home/phiros/dev/leanovate/cl/myke/examples/tag/tags1.yml
tags2/tag       tagB,tagC       run as myke tag (or) tags2/tag (or) tagB/tag (or) tagC/tag      /home/phiros/dev/leanovate/cl/myke/examples/tag/tags2.yml
template/args           run as myke template/args[from=...,to=...]      /home/phiros/dev/leanovate/cl/myke/examples/template/myke.yml
template/envs           run as myke template/envs       /home/phiros/dev/leanovate/cl/myke/examples/template/myke.yml
template/file           run as myke template/file       /home/phiros/dev/leanovate/cl/myke/examples/template/myke.yml
shell/echo                      /home/phiros/dev/leanovate/cl/myke/examples/shell/myke.yml
shell/error                     /home/phiros/dev/leanovate/cl/myke/examples/shell/myke.yml
shell/shell                     /home/phiros/dev/leanovate/cl/myke/examples/shell/myke.yml
shell/subshell                  /home/phiros/dev/leanovate/cl/myke/examples/shell/myke.yml

This might not look super nice but it does the job AND it is super easy to parse. If readability is a concern
one could also use https://golang.org/pkg/text/tabwriter/ to align the text better but I think this would make parsing the output more difficult...

@rdsubhas
Copy link
Member

rdsubhas commented Nov 6, 2019

Hi @PhilippRosenkranz I'm really sorry this missed our radar, we're moving our open source projects to github.com/omio-labs with a faster process. Sorry, closing this and will re-open there...

@rdsubhas rdsubhas closed this Nov 6, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Bash completion
3 participants