Skip to content

Commit 5eb8199

Browse files
author
Matt Pearson
committed
Add docs for positional args.
1 parent f6036b5 commit 5eb8199

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

deploy.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ set -o errexit #abort if any command fails
33
me=$(basename "$0")
44

55
help_message="\
6-
Usage: $me [-c FILE] [<options>]
6+
Usage: $me [-c <FILE>] [<options>] [<directory> [<branch> [<repository>]]]
77
Deploy generated files to a git branch.
88
99
Options:
@@ -28,7 +28,14 @@ Variables:
2828
These variables have default values defined in the script. The defaults can be
2929
overridden by environment variables. Any environment variables are overridden
3030
by values set in a '.env' file (if it exists), and in turn by those set in a
31-
file specified by the '--config-file' option."
31+
file specified by the '--config-file' option.
32+
33+
Positional Args:
34+
35+
At the end of the command, you can optionally specify the directory, branch,
36+
and repository as well. Earlier values are required to specify later ones. For
37+
example, in order to specify <branch>, you must also specify <directory>. Like
38+
the command-line options, these"
3239

3340
parse_args() {
3441
# Set args from a local environment file.

readme.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,9 @@ Do this every time you want to deploy, or have your CI server do it.
3737
5. run `./deploy.sh`
3838

3939
### options
40+
41+
`deploy.sh [--config <FILE>] [<options>] [<directory> [<branch> [<repository>]]]`
42+
4043
`-h`, `--help`: show the program's help info.
4144

4245
`-c`, `--config-file`: specify a file that overrides the script's default configuration, or those values set in `.env`. The syntax for this file should be normal `var=value` declarations. __This option _must_ come first on the command-line__.
@@ -48,3 +51,5 @@ Do this every time you want to deploy, or have your CI server do it.
4851
`-v`, `--verbose`: echo expanded commands as they are executed, using the xtrace option. This can be useful for debugging, as the output will include the values of variables that are being used, such as $commit_title and $deploy_directory. However, the script makes special effort to not output the value of $repo, as it may contain a secret authentication token.
4952

5053
`-e`, `--allow-empty`: allow deployment of an empty directory. By default, the script will abort if `deploy_directory` is empty.
54+
55+
`[<directory> [<branch> [<repository>]]]`: set the directory/branch/repository. __These options _must_ come at the end of the command-line__. Also, in order to specify later options, you _must_ specify each earlier one. So in order to specify "repository", you need to also specify "directory" and "branch".

0 commit comments

Comments
 (0)