Skip to content

Commit 74c3486

Browse files
Improve upload_dir command help strings
Co-authored-by: carlevison <[email protected]>
1 parent df74cc4 commit 74c3486

File tree

1 file changed

+14
-8
lines changed

1 file changed

+14
-8
lines changed

cloudinary_cli/modules/upload_dir.py

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
from os.path import dirname, join as path_join
33
from pathlib import Path
44

5-
from click import command, argument, option, style
5+
from click import command, argument, option, style, launch
66

77
from cloudinary_cli.utils.api_utils import upload_file
88
from cloudinary_cli.utils.file_utils import get_destination_folder, is_hidden_path
@@ -21,19 +21,25 @@
2121
help="Pass optional parameters as interpreted strings.")
2222
@option("-t", "--transformation", help="The transformation to apply on all uploads.")
2323
@option("-f", "--folder", default="",
24-
help="The Cloudinary folder where you want to upload the assets. "
25-
"You can specify a whole path, for example folder1/folder2/folder3. "
26-
"If your product environment uses fixed folder mode, then any folders that do not exist are automatically created.")
24+
help="The path where you want to upload the assets. "
25+
"The path you specify will be pre-pended to the public IDs of the uploaded assets. "
26+
"You can specify a whole path, for example path1/path2/path3. "
27+
"If your product environment uses fixed folder mode, then any folders that do not exist are "
28+
"automatically created.")
2729
@option("-p", "--preset", help="The upload preset to use.")
2830
@option("-e", "--exclude-dir-name", is_flag=True, default=False,
29-
help="Don't include the selected parent directory name in the public ID path of the uploaded files."
30-
"This ensures that the public ID paths of the uploaded assets will be directly under the specified --(f)older, avoiding an extraneous level in the path."
31-
"When this option is used, the contents of the parent directory are uploaded instead of the parent directory itself and thus the name of the specified parent directory is not included in the pubic ID path of the uploaded assets.")
31+
help="When this option is used, the contents of the parent directory are uploaded but not the parent "
32+
"directory itself. Thus, the name of the specified parent directory is not included "
33+
"in the pubic ID path of the uploaded assets.")
3234
@option("-w", "--concurrent_workers", type=int, default=30, help="Specify the number of concurrent network threads.")
35+
@option("-d", "--doc", is_flag=True, help="Open upload_dir command documentation page.")
3336
def upload_dir(directory, glob_pattern, include_hidden, optional_parameter, optional_parameter_parsed, transformation,
34-
folder, preset, concurrent_workers, exclude_dir_name):
37+
folder, preset, concurrent_workers, exclude_dir_name, doc):
3538
items, skipped = {}, {}
3639

40+
if doc:
41+
return launch("https://cloudinary.com/documentation/cloudinary_cli#upload_dir")
42+
3743
dir_to_upload = Path(path_join(getcwd(), directory))
3844
if not dir_to_upload.exists():
3945
logger.error(f"Directory: {dir_to_upload} does not exist")

0 commit comments

Comments
 (0)