LEFT | RIGHT |
1 # -*- coding: utf-8 -*- | 1 # -*- coding: utf-8 -*- |
2 # Copyright 2012 Google Inc. All Rights Reserved. | 2 # Copyright 2012 Google Inc. All Rights Reserved. |
3 # | 3 # |
4 # Licensed under the Apache License, Version 2.0 (the "License"); | 4 # Licensed under the Apache License, Version 2.0 (the "License"); |
5 # you may not use this file except in compliance with the License. | 5 # you may not use this file except in compliance with the License. |
6 # You may obtain a copy of the License at | 6 # You may obtain a copy of the License at |
7 # | 7 # |
8 # http://www.apache.org/licenses/LICENSE-2.0 | 8 # http://www.apache.org/licenses/LICENSE-2.0 |
9 # | 9 # |
10 # Unless required by applicable law or agreed to in writing, software | 10 # Unless required by applicable law or agreed to in writing, software |
(...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
92 Match any of the range of characters. For example | 92 Match any of the range of characters. For example |
93 "gs://bucket/[a-m].txt" matches objects that contain letters | 93 "gs://bucket/[a-m].txt" matches objects that contain letters |
94 a, b, c, ... or m, and end with .txt. | 94 a, b, c, ... or m, and end with .txt. |
95 | 95 |
96 You can combine wildcards to provide more powerful matches, for example: | 96 You can combine wildcards to provide more powerful matches, for example: |
97 | 97 |
98 gs://bucket/[a-m]??.j*g | 98 gs://bucket/[a-m]??.j*g |
99 | 99 |
100 | 100 |
101 <B>POTENTIALLY SURPRISING BEHAVIOR WHEN USING WILDCARDS</B> | 101 <B>POTENTIALLY SURPRISING BEHAVIOR WHEN USING WILDCARDS</B> |
102 There are a couple of ways that using wildcards can result in surprising behav
ior: | 102 There are a couple of ways that using wildcards can result in surprising |
| 103 behavior: |
103 | 104 |
104 1. Shells (like bash and zsh) can attempt to expand wildcards before passing | 105 1. Shells (like bash and zsh) can attempt to expand wildcards before passing |
105 the arguments to gsutil. If the wildcard was supposed to refer to a cloud | 106 the arguments to gsutil. If the wildcard was supposed to refer to a cloud |
106 object, this can result in surprising "Not found" errors (e.g., if the | 107 object, this can result in surprising "Not found" errors (e.g., if the |
107 shell tries to expand the wildcard "gs://my-bucket/*" on the local | 108 shell tries to expand the wildcard "gs://my-bucket/*" on the local |
108 machine, matching no local files, and failing the command). | 109 machine, matching no local files, and failing the command). |
109 | 110 |
110 Note that some shells include additional characters in their wildcard | 111 Note that some shells include additional characters in their wildcard |
111 character sets. For example, if you use zsh with the extendedglob option | 112 character sets. For example, if you use zsh with the extendedglob option |
112 enabled it will treat "#" as a special character, which conflicts with | 113 enabled it will treat "#" as a special character, which conflicts with |
(...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
224 | 225 |
225 # Help specification. See help_provider.py for documentation. | 226 # Help specification. See help_provider.py for documentation. |
226 help_spec = HelpProvider.HelpSpec( | 227 help_spec = HelpProvider.HelpSpec( |
227 help_name='wildcards', | 228 help_name='wildcards', |
228 help_name_aliases=['wildcard', '*', '**'], | 229 help_name_aliases=['wildcard', '*', '**'], |
229 help_type='additional_help', | 230 help_type='additional_help', |
230 help_one_line_summary='Wildcard Names', | 231 help_one_line_summary='Wildcard Names', |
231 help_text=_DETAILED_HELP_TEXT, | 232 help_text=_DETAILED_HELP_TEXT, |
232 subcommand_help_text={}, | 233 subcommand_help_text={}, |
233 ) | 234 ) |
LEFT | RIGHT |