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

make all action handlers "forcable" via CLI, and therefore scriptable. #13

Open
joelmccracken opened this issue Aug 2, 2020 · 2 comments

Comments

@joelmccracken
Copy link
Owner

Considering @Vladciobanu made #10 , I wonder if it would make sense to have a force option for every interactive action?

And this makes me wonder if there would be a way to serialize the data structure automatically? That might actually be really nice, but I don't know how it would be done.

What would be cool with this is that you could write a shell script that automatically interacts with the CLI.

@eviefp
Copy link

eviefp commented Aug 13, 2020

What about some DSL instead? Say we have this sort of ADT that expresses the states we may find the repository, like "Uncomitted", "Unpushed", etc. We could then have a DSL that essentially allows us to pattern match over these states and return an "action". We could run this action repeatedly until it returns the "Done" action.

The actions could be things that we'd expect to use often like commit, push, pull, set upstream, etc., but also perhaps just custom shell commands in case the user just wants to do something we didn't expect.

We could even allow users to store multiple such handlers, and pick and choose their favorite. I expect we could remove some of our code and move it to handlers and use those as some sort of "stdlib"/examples.

So essentially, instead of throwing out json, I'm saying, why not write our own specific language for this :)

@joelmccracken
Copy link
Owner Author

sure, the only reason i picked json is because it can integrate with jq, a lot of other languages have good support for it. My mental model is to create ADTs that have ToJSON/FromJSON instances, so it would be able to support both fairly naturally.

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

No branches or pull requests

2 participants