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

Added a way to extend dstask without cluttering the core #130

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

cgardner
Copy link
Contributor

@cgardner cgardner commented Mar 4, 2021

This was inspired by the way git allows you to add sub-commands using
the git-command convention and run the command using git command.
This is a very primitive version of that.

It'll also allow us to develop tools (gantt charts?) without
cluttering up the core application.

This was inspired by the way git allows you to add sub-commands using
the `git-command` convention and run the command using `git command`.
This is a very primitive version of that to allow users to extend dstask
with the tools they're familiar with.

It'll also allow us to develop tools (gantt charts anybody) without
cluttering up the core application.
@Dieterbe
Copy link
Contributor

Dieterbe commented Mar 4, 2021

if you have a binary git-command why would you want to run it as git command ?

@cgardner
Copy link
Contributor Author

cgardner commented Mar 4, 2021

if you have a binary git-command why would you want to run it as git command ?

For me, it fits nicely into the workflow and will work with any shortcuts you have set up. For example, I have aliases for git (g) and dstask (,t). Rather than remembering that there are two ways to do it, I can use my alias to fit my workflow.

@naggie
Copy link
Owner

naggie commented Mar 4, 2021

Definitely an interesting idea to extend dstask. I think this needs to be driven by specific use cases, like the importer.

We could also consider some interoperability requirements, so dstask can discover these cmdlets and query them for what they do; another possible justification for this mechanism.

@dontlaugh
Copy link
Contributor

Prior art here is the Hashicorp suite of products, and they have one more layer of sophistication. The binary naming scheme for several of their products lets you specify a type. For the Packer machine image builder, for instance:

packer-${type}-${pluginname}

Examples of the "builder" and "provisioner" type:

So for the dstask plugin type that creates a new subcommand, we might prefer a naming scheme that embeds the "cmd" or "subcmd" string to indicate a type:

dstask-cmd-foo

This leaves open the possibility of specifying other types, which we have discussed in the past.

dstask-precommit-foo
dstask-output-blah

If we do not adopt this convention early, it might be harder to disambiguate later.

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.

4 participants