Skip to content
This repository was archived by the owner on Jun 11, 2021. It is now read-only.

Commit fb78870

Browse files
committed
Update README
1 parent 57708d0 commit fb78870

File tree

1 file changed

+34
-3
lines changed

1 file changed

+34
-3
lines changed

README.md

Lines changed: 34 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,12 +76,43 @@ terraform-digitalocean-droplet:
7676
You can specify modules using Terraform's `source` specifications:
7777
https://www.terraform.io/docs/modules/sources.html
7878

79+
### Versions
7980
The `version` can be a tag, a branch or a commit hash. By default, `xterrafile`
8081
will checkout the default branch of a module which is usually `master`.
8182

82-
Modules will be downloaded to `./vendor/xterrafile/` by default.
83+
When using modules from a Terraform registry you can specify version ranges like:
8384

84-
### Example Usage
85+
- `<1.0.0` Less than `1.0.0`
86+
- `<=1.0.0` Less than or equal to `1.0.0`
87+
- `>1.0.0` Greater than `1.0.0`
88+
- `>=1.0.0` Greater than or equal to `1.0.0`
89+
- `1.0.0`, `=1.0.0`, `==1.0.0` Equal to `1.0.0`
90+
- `!1.0.0`, `!=1.0.0` Not equal to `1.0.0`. Excludes version `1.0.0`.
91+
92+
Note that spaces between the operator and the version will be gracefully tolerated.
93+
94+
A `Range` can link multiple `Ranges` separated by space:
95+
96+
Ranges can be linked by logical AND:
97+
98+
- `>1.0.0 <2.0.0` would match between both ranges, so `1.1.1` and `1.8.7` but not `1.0.0` or `2.0.0`
99+
- `>1.0.0 <3.0.0 !2.0.3-beta.2` would match every version between `1.0.0` and `3.0.0` except `2.0.3-beta.2`
100+
101+
Ranges can also be linked by logical OR:
102+
103+
- `<2.0.0 || >=3.0.0` would match `1.x.x` and `3.x.x` but not `2.x.x`
104+
105+
AND has a higher precedence than OR. It's not possible to use brackets.
106+
107+
Ranges can be combined by both AND and OR
108+
109+
- `>1.0.0 <2.0.0 || >3.0.0 !4.2.1` would match `1.2.3`, `1.9.9`, `3.1.1`, but not `4.2.1`, `2.1.1`
110+
111+
112+
### Module Download Location
113+
Modules will be downloaded to `./vendor/modules/` by default.
114+
115+
## Example Usage
85116
Help:
86117
```
87118
xterrafile help
@@ -96,7 +127,7 @@ Available Commands:
96127
version Show version information for xterrafile
97128
98129
Flags:
99-
-d, --directory string module directory (default "vendor/xterrafile")
130+
-d, --directory string module directory (default "vendor/modules")
100131
-f, --file string config file (default "Terrafile")
101132
-h, --help help for xterrafile
102133

0 commit comments

Comments
 (0)