zerovm / zpm

ZeroVM Package Manager
Apache License 2.0
6 stars 11 forks source link

Reorder `zpm deploy` args #111

Closed larsbutler closed 10 years ago

larsbutler commented 10 years ago

In the python-swiftclient, uploading a file looks like this:

swift upload <container> <file>

Deploying (uploading) a file with zpm looks like this:

zpm deploy <file> <container>

When using zpm, often find myself using swift as well to create new containers on Swit/ZeroCloud, list containers/files, and upload files. It would be great if had some consistency among these tools for similar operations. I constantly have to check the --help for both tools because I forget which one is which.

mgeisler commented 10 years ago

Have you considered that zpm deploy foo bar is similar to cp foo bar, mv foo bar, or git clone http://some/server/foo bar?

I think the swift tool uses the other ordering due to the support for uploading multiple files into a single container. They probably preferred to let the variable number of arguments be last (as in Python) instead of first (as cp does it).

larsbutler commented 10 years ago

I hadn't considered that, but by that logic, this change might make even more sense. It could be useful to deploy multiple zapps in one shot. For example, if I'm pushing new versions of my applications to ZeroCloud during a maintenance window, etc., it would be convenient to do them all with one command--just like uploading a new batch of files with swift upload.

willkelly commented 10 years ago

While I agree with mg regarding unixy clis, I think in this case that consistency with the swift cli is important, as the two will frequently be used in tandem.

mgeisler commented 10 years ago

I'm not completely against this change, I just want to make sure we agree that I didn't choose the ordering for fun :-)

@larsbutler I guess you noticed that the ordering doesn't matter with regard to the ability to deploy multiple zapps with one call? That is, it would be possible to implement both zpm deploy container foo bar and zpm deploy foo bar container.

@willkelly I do like consistency! Notice, however, that the first argument to zpm deploy isn't a container name — it is a a container plus any prefix you might want to use (the virtual folder structure supported by Swift). So you can do

$ zpm deploy foo.zapp some-container/my/nice/apps

The swift utility works slightly different. There you must say

$ swift upload some-container my/nice/apps/foo.zapp

and the folder structure you're creating must thus already exist locally.

mgeisler commented 10 years ago

I went ahead and merged the pull request since Will also likes it.