Last active
December 20, 2015 04:29
-
-
Save jkbrzt/6070786 to your computer and use it in GitHub Desktop.
Opbeat CLI syntax survey
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# Opbeat is looking for the best CLI syntax for the `opbeat' | |
# command that sends deployment info to the Opbeat API. | |
# | |
# Users should be able to specify repositories that the app being deployed | |
# consists of and their attributes. | |
# | |
# The attributes are "name", "version", "vcs", "rev", "branch", "remote_url". | |
# | |
# We are considering these syntaxes: | |
# | |
### 1. --repo takes one argument, a string of comma-separated key=value pairs: | |
$ opbeat deployment \ | |
--repo name=myapp,version=1.0,vcs=git,branch=master,[email protected]:myorg/app.git,rev=hash \ | |
--repo name=myapp2,version=1.0,vcs=git,branch=master,[email protected]:myorg/app2.git,rev=hash | |
### 2. --repo takes multiple arguments, each is a key=value pair. | |
$ opbeat deployment \ | |
--repo \ | |
name=myapp \ | |
version=1.0 \ | |
vcs=git \ | |
branch=master \ | |
[email protected]:opbeat/opbeatcli.git \ | |
rev=hash \ | |
--repo \ | |
name=myapp2 \ | |
version=1.0 \ | |
vcs=git \ | |
branch=master \ | |
[email protected]:myorg/app2.git \ | |
rev=hash | |
# | |
# Please let us know what you think. Thanks! | |
# |
Then, I would probably implement it as:
Usage: opbeat deployment (<name> <url>)...
Arguments:
<name> Repository name.
<url> Pip-style URL.
And use it as:
$ opbeat deployment \
myapp [email protected]:myorg/[email protected] \
myapp2 [email protected]:myorg/[email protected]
Assuming versions are tags.
It's a good suggestion but we need it to be extensible (more fields can be added in the future).
#1 is easier to type, but #2 is easier to read. I prefer #2.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You could make it shorter by borrowing the syntax from pip:
This includes vcs, version/branch/hash and remote-url.