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

Better handling for default commands #8

Open
Sopamo opened this issue Aug 1, 2022 · 3 comments
Open

Better handling for default commands #8

Sopamo opened this issue Aug 1, 2022 · 3 comments

Comments

@Sopamo
Copy link
Owner

Sopamo commented Aug 1, 2022

When I execute v replace my-project because I misremembered the syntax, via will call replace for the current project (which doesn't make sense) instead of doing what I want.

We should remove replace and start from the default commands that are set for the active project and also throw an error if you pass invalid arguments to one of the default commands.

@fieteboerner
Copy link
Collaborator

I get your point. From my perspective I would try to keep at least the start command to start the current active project quickly. I think there are some use cases where via start is a great short way to make all the services of a project run.
Examples, coming into my mind:

  • to start the services after a reboot (because the current active project is persistent)
  • if a container/service dies sometimes, you can start over very fast
  • for people working on a single project (at least for a longer period of time) it could be tedious to type the project name again and again.

I think we could either throw an error if arguments are passed to a start command, as you have suggested, or start the given project if a valid project name was passed as the first argument. (the last point feels weird to me, because we would establish a different undocumented API)

@fieteboerner
Copy link
Collaborator

Another possibility could be, to change the signature of start/stop/replace so we could pass the project name after the action.

like this

via start [<project name>] -- if omitted, the current active project will be used
via replace <project name> -- if omitted, it should throw an error
via stop [<project name>] -- if omitted, the current active project will be used

@Sopamo
Copy link
Owner Author

Sopamo commented Aug 1, 2022

Ah, true, leaving start makes sense. Maybe we can then just leave replace as well to not have an exception only for that. I think we should throw an exception to let the user know that they did something wrong.

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