| 169 | |
| 170 | |
| 171 | def build_parser(): |
| 172 | parser = argparse.ArgumentParser( |
| 173 | formatter_class=argparse.RawDescriptionHelpFormatter, |
| 174 | description=__doc__) |
| 175 | |
| 176 | aws_group = parser.add_mutually_exclusive_group() |
| 177 | aws_group.add_argument('-k', '--aws-access-key-id', |
| 178 | help='public AWS access key. Can also be defined ' |
| 179 | 'in an environment variable. If both are defined, ' |
| 180 | 'the one defined in the programs arguments takes ' |
| 181 | 'precedence.') |
| 182 | |
| 183 | aws_group.add_argument('--aws-instance-profile', action='store_true', |
| 184 | help='Use the IAM Instance Profile associated ' |
| 185 | 'with this instance to authenticate with the S3 ' |
| 186 | 'API. Can also be defined by setting the ' |
| 187 | 'environment variable AWS_INSTANCE_PROFILE=1.') |
| 188 | |
| 189 | gs_group = parser.add_mutually_exclusive_group() |
| 190 | gs_group.add_argument('--gs-access-key-id', |
| 191 | help='public GS access key. Can also be defined ' |
| 192 | 'in an environment variable. If both are defined, ' |
| 193 | 'the one defined in the programs arguments takes ' |
| 194 | 'precedence.') |
| 195 | |
| 196 | parser.add_argument('-a', '--wabs-account-name', |
| 197 | help='Account name of Windows Azure Blob Service ' |
| 198 | 'account. Can also be defined in an environment' |
| 199 | 'variable. If both are defined, the one defined' |
| 200 | 'in the programs arguments takes precedence.') |
| 201 | |
| 202 | parser.add_argument('--s3-prefix', |
| 203 | help='S3 prefix to run all commands against. ' |
| 204 | 'Can also be defined via environment variable ' |
| 205 | 'WALE_S3_PREFIX.') |
| 206 | |
| 207 | parser.add_argument('--wabs-prefix', |
| 208 | help='WABS prefix to run all commands against. ' |
| 209 | 'Can also be defined via environment variable ' |
| 210 | 'WALE_WABS_PREFIX.') |
| 211 | |
| 212 | parser.add_argument('--gs-prefix', |
| 213 | help='Storage prefix to run all commands against. ' |
| 214 | 'Can also be defined via environment variable ' |
| 215 | 'WALE_GS_PREFIX.') |
| 216 | |
| 217 | parser.add_argument('--file-prefix', |
| 218 | help='File prefix to run all commands against. ' |
| 219 | 'Can also be defined via environment variable ' |
| 220 | 'WALE_FILE_PREFIX.') |
| 221 | |
| 222 | parser.add_argument( |
| 223 | '--gpg-key-id', |
| 224 | help='GPG key ID to encrypt to. (Also needed when decrypting.) ' |
| 225 | 'Can also be defined via environment variable ' |
| 226 | 'WALE_GPG_KEY_ID') |
| 227 | |
| 228 | parser.add_argument( |