Skip to content

Commit 704cdec

Browse files
committed
[FEATURE] Add -SM/-sm/--share-mode flag | Resolve #139
Specify the share mode for sharing file. Share modes are: - r / reader - Read only permission. - w / writer - Read and write permission. - c / commenter - Comment only permission. Note: Although this flag is independent of --share flag but when email is needed, then --share flag use is neccessary. In output, show which mode used for sharing file (SHARED[w]) means shared with write perms
1 parent 346e118 commit 704cdec

File tree

7 files changed

+114
-20
lines changed

7 files changed

+114
-20
lines changed

README.md

+14
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,20 @@ These are the custom flags that are currently implemented:
552552

553553
---
554554

555+
- <strong>-SM | -sm | --share-mode 'share mode'</strong>
556+
557+
Specify the share mode for sharing file.
558+
559+
Share modes are:
560+
561+
- r / reader - Read only permission.
562+
- w / writer - Read and write permission.
563+
- c / commenter - Comment only permission.
564+
565+
Note: Although this flag is independent of --share flag but when email is needed, then --share flag use is neccessary.
566+
567+
---
568+
555569
- <strong>--speed 'speed'</strong>
556570

557571
Limit the download speed, supported formats: 1K, 1M and 1G.

bash/drive-utils.bash

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ _full_upload() {
394394
###################################################
395395
_share_id() {
396396
[[ $# -lt 2 ]] && printf "%s: Missing arguments\n" "${FUNCNAME[0]}" && return 1
397-
declare id="${1}" share_email="${2}" role="reader"
397+
declare id="${1}" role="${2:?Missing role}" share_email="${3}"
398398
declare type="${share_email:+user}" share_post_data share_post_data share_response
399399

400400
"${EXTRA_LOG}" "justify" "Sharing.." "-" 1>&2

bash/release/gupload

+25-5
Original file line numberDiff line numberDiff line change
@@ -1318,7 +1318,7 @@ _full_upload() {
13181318
###################################################
13191319
_share_id() {
13201320
[[ $# -lt 2 ]] && printf "%s: Missing arguments\n" "${FUNCNAME[0]}" && return 1
1321-
declare id="${1}" share_email="${2}" role="reader"
1321+
declare id="${1}" role="${2:?Missing role}" share_email="${3}"
13221322
declare type="${share_email:+user}" share_post_data share_post_data share_response
13231323

13241324
"${EXTRA_LOG}" "justify" "Sharing.." "-" 1>&2
@@ -1554,6 +1554,11 @@ Options:\n
15541554
Note: For files inside folders, use --description-all flag.\n
15551555
-d | --skip-duplicates - Do not upload the files with the same name, if already present in the root folder/input folder, also works with recursive folders.\n
15561556
-S | --share <optional_email_address>- Share the uploaded input file/folder, grant reader permission to provided email address or to everyone with the shareable link.\n
1557+
-SM | -sm | --share-mode 'share mode' - Specify the share mode for sharing file.\n
1558+
Share modes are: r / reader - Read only permission.\n
1559+
: w / writer - Read and write permission.\n
1560+
: c / commenter - Comment only permission.\n
1561+
Note: Although this flag is independent of --share flag but when email is needed, then --share flag use is neccessary.\n
15571562
--speed 'speed' - Limit the download speed, supported formats: 1K, 1M and 1G.\n
15581563
-i | --save-info <file_to_save_info> - Save uploaded files info to the given filename.\n
15591564
-z | --config <config_path> - Override default config file with custom config file.\nIf you want to change default value, then use this format -z/--config default=default=your_config_file_path.\n
@@ -1646,7 +1651,7 @@ _setup_arguments() {
16461651
# De-initialize if any variables set already.
16471652
unset LIST_ACCOUNTS UPDATE_DEFAULT_ACCOUNT CUSTOM_ACCOUNT_NAME NEW_ACCOUNT_NAME DELETE_ACCOUNT_NAME ACCOUNT_ONLY_RUN
16481653
unset FOLDERNAME LOCAL_INPUT_ARRAY ID_INPUT_ARRAY CONTINUE_WITH_NO_INPUT
1649-
unset PARALLEL NO_OF_PARALLEL_JOBS SHARE SHARE_EMAIL OVERWRITE SKIP_DUPLICATES DESCRIPTION SKIP_SUBDIRS ROOTDIR QUIET
1654+
unset PARALLEL NO_OF_PARALLEL_JOBS SHARE SHARE_ROLE SHARE_EMAIL OVERWRITE SKIP_DUPLICATES DESCRIPTION SKIP_SUBDIRS ROOTDIR QUIET
16501655
unset VERBOSE VERBOSE_PROGRESS DEBUG LOG_FILE_ID CURL_SPEED RETRY
16511656
export CURL_PROGRESS="-s" EXTRA_LOG=":" CURL_PROGRESS_EXTRA="-s"
16521657
INFO_PATH="${HOME}/.google-drive-upload" CONFIG_INFO="${INFO_PATH}/google-drive-upload.configpath"
@@ -1748,6 +1753,21 @@ _setup_arguments() {
17481753
if [[ -n ${2} && ! ${2} = -* && ${2} =~ ${EMAIL_REGEX} ]]; then
17491754
SHARE_EMAIL="${2}" && shift && export SHARE_EMAIL
17501755
fi
1756+
SHARE_ROLE="${SHARE_ROLE:-reader}"
1757+
;;
1758+
-[Ss][Mm] | --share-mode)
1759+
_check_longoptions "${1}" "${2}"
1760+
case "${2}" in
1761+
r | read*) SHARE_ROLE="reader" ;;
1762+
w | write*) SHARE_ROLE="writer" ;;
1763+
c | comment*) SHARE_ROLE="commenter" ;;
1764+
*)
1765+
printf "%s\n" "Invalid share mode given ( ${2} ). Supported values are r or reader / w or writer / c or commenter." &&
1766+
exit 1
1767+
;;
1768+
esac
1769+
SHARE="_share_id"
1770+
shift
17511771
;;
17521772
--speed)
17531773
_check_longoptions "${1}" "${2}"
@@ -1928,7 +1948,7 @@ _setup_workspace() {
19281948
# WORKSPACE_FOLDER_ID, UPLOAD_MODE, SKIP_DUPLICATES, OVERWRITE, SHARE,
19291949
# UPLOAD_STATUS, COLUMNS, API_URL, API_VERSION, TOKEN_URL, LOG_FILE_ID
19301950
# FILE_ID, FILE_LINK, FINAL_ID_INPUT_ARRAY ( array )
1931-
# PARALLEL_UPLOAD, QUIET, NO_OF_PARALLEL_JOBS, TMPFILE
1951+
# PARALLEL_UPLOAD, QUIET, NO_OF_PARALLEL_JOBS, TMPFILE, SHARE_ROLE
19321952
# Functions - _print_center, _clear_line, _newline, _support_ansi_escapes, _print_center_quiet
19331953
# _upload_file, _share_id, _is_terminal, _dirname,
19341954
# _create_directory, _json_value, _url_encode, _check_existing_file, _bytes_to_human
@@ -1939,9 +1959,9 @@ _setup_workspace() {
19391959
_process_arguments() {
19401960
# on successful uploads
19411961
_share_and_print_link() {
1942-
"${SHARE:-:}" "${1:-}" "${SHARE_EMAIL}"
1962+
"${SHARE:-:}" "${1:-}" "${SHARE_ROLE}" "${SHARE_EMAIL}"
19431963
[[ -z ${HIDE_INFO} ]] && {
1944-
_print_center "justify" "DriveLink" "${SHARE:+ (SHARED)}" "-"
1964+
_print_center "justify" "DriveLink" "${SHARE:+ (SHARED[${SHARE_ROLE:0:1}])}" "-"
19451965
_support_ansi_escapes && [[ ${COLUMNS} -gt 45 ]] && _print_center "normal" "↓ ↓ ↓" ' '
19461966
"${QUIET:-_print_center}" "normal" "https://drive.google.com/open?id=${1:-}" " "
19471967
}

bash/upload.bash

+24-4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ Options:\n
2828
Note: For files inside folders, use --description-all flag.\n
2929
-d | --skip-duplicates - Do not upload the files with the same name, if already present in the root folder/input folder, also works with recursive folders.\n
3030
-S | --share <optional_email_address>- Share the uploaded input file/folder, grant reader permission to provided email address or to everyone with the shareable link.\n
31+
-SM | -sm | --share-mode 'share mode' - Specify the share mode for sharing file.\n
32+
Share modes are: r / reader - Read only permission.\n
33+
: w / writer - Read and write permission.\n
34+
: c / commenter - Comment only permission.\n
35+
Note: Although this flag is independent of --share flag but when email is needed, then --share flag use is neccessary.\n
3136
--speed 'speed' - Limit the download speed, supported formats: 1K, 1M and 1G.\n
3237
-i | --save-info <file_to_save_info> - Save uploaded files info to the given filename.\n
3338
-z | --config <config_path> - Override default config file with custom config file.\nIf you want to change default value, then use this format -z/--config default=default=your_config_file_path.\n
@@ -120,7 +125,7 @@ _setup_arguments() {
120125
# De-initialize if any variables set already.
121126
unset LIST_ACCOUNTS UPDATE_DEFAULT_ACCOUNT CUSTOM_ACCOUNT_NAME NEW_ACCOUNT_NAME DELETE_ACCOUNT_NAME ACCOUNT_ONLY_RUN
122127
unset FOLDERNAME LOCAL_INPUT_ARRAY ID_INPUT_ARRAY CONTINUE_WITH_NO_INPUT
123-
unset PARALLEL NO_OF_PARALLEL_JOBS SHARE SHARE_EMAIL OVERWRITE SKIP_DUPLICATES DESCRIPTION SKIP_SUBDIRS ROOTDIR QUIET
128+
unset PARALLEL NO_OF_PARALLEL_JOBS SHARE SHARE_ROLE SHARE_EMAIL OVERWRITE SKIP_DUPLICATES DESCRIPTION SKIP_SUBDIRS ROOTDIR QUIET
124129
unset VERBOSE VERBOSE_PROGRESS DEBUG LOG_FILE_ID CURL_SPEED RETRY
125130
export CURL_PROGRESS="-s" EXTRA_LOG=":" CURL_PROGRESS_EXTRA="-s"
126131
INFO_PATH="${HOME}/.google-drive-upload" CONFIG_INFO="${INFO_PATH}/google-drive-upload.configpath"
@@ -222,6 +227,21 @@ _setup_arguments() {
222227
if [[ -n ${2} && ! ${2} = -* && ${2} =~ ${EMAIL_REGEX} ]]; then
223228
SHARE_EMAIL="${2}" && shift && export SHARE_EMAIL
224229
fi
230+
SHARE_ROLE="${SHARE_ROLE:-reader}"
231+
;;
232+
-[Ss][Mm] | --share-mode)
233+
_check_longoptions "${1}" "${2}"
234+
case "${2}" in
235+
r | read*) SHARE_ROLE="reader" ;;
236+
w | write*) SHARE_ROLE="writer" ;;
237+
c | comment*) SHARE_ROLE="commenter" ;;
238+
*)
239+
printf "%s\n" "Invalid share mode given ( ${2} ). Supported values are r or reader / w or writer / c or commenter." &&
240+
exit 1
241+
;;
242+
esac
243+
SHARE="_share_id"
244+
shift
225245
;;
226246
--speed)
227247
_check_longoptions "${1}" "${2}"
@@ -402,7 +422,7 @@ _setup_workspace() {
402422
# WORKSPACE_FOLDER_ID, UPLOAD_MODE, SKIP_DUPLICATES, OVERWRITE, SHARE,
403423
# UPLOAD_STATUS, COLUMNS, API_URL, API_VERSION, TOKEN_URL, LOG_FILE_ID
404424
# FILE_ID, FILE_LINK, FINAL_ID_INPUT_ARRAY ( array )
405-
# PARALLEL_UPLOAD, QUIET, NO_OF_PARALLEL_JOBS, TMPFILE
425+
# PARALLEL_UPLOAD, QUIET, NO_OF_PARALLEL_JOBS, TMPFILE, SHARE_ROLE
406426
# Functions - _print_center, _clear_line, _newline, _support_ansi_escapes, _print_center_quiet
407427
# _upload_file, _share_id, _is_terminal, _dirname,
408428
# _create_directory, _json_value, _url_encode, _check_existing_file, _bytes_to_human
@@ -413,9 +433,9 @@ _setup_workspace() {
413433
_process_arguments() {
414434
# on successful uploads
415435
_share_and_print_link() {
416-
"${SHARE:-:}" "${1:-}" "${SHARE_EMAIL}"
436+
"${SHARE:-:}" "${1:-}" "${SHARE_ROLE}" "${SHARE_EMAIL}"
417437
[[ -z ${HIDE_INFO} ]] && {
418-
_print_center "justify" "DriveLink" "${SHARE:+ (SHARED)}" "-"
438+
_print_center "justify" "DriveLink" "${SHARE:+ (SHARED[${SHARE_ROLE:0:1}])}" "-"
419439
_support_ansi_escapes && [[ ${COLUMNS} -gt 45 ]] && _print_center "normal" "↓ ↓ ↓" ' '
420440
"${QUIET:-_print_center}" "normal" "https://drive.google.com/open?id=${1:-}" " "
421441
}

sh/drive-utils.sh

+1-1
Original file line numberDiff line numberDiff line change
@@ -398,7 +398,7 @@ _full_upload() {
398398
###################################################
399399
_share_id() {
400400
[ $# -lt 2 ] && printf "Missing arguments\n" && return 1
401-
id_share_id="${1}" share_email_share_id="${2}" role_share_id="reader" type_share_id="${share_email_share_id:+user}"
401+
id_share_id="${1}" role_share_id="${2:?Missing role}" share_email_share_id="${3}" role_share_id="reader" type_share_id="${share_email_share_id:+user}"
402402
unset post_data_share_id response_share_id
403403
404404
"${EXTRA_LOG}" "justify" "Sharing.." "-" 1>&2

sh/release/gupload

+25-5
Original file line numberDiff line numberDiff line change
@@ -1263,7 +1263,7 @@ _full_upload() {
12631263
###################################################
12641264
_share_id() {
12651265
[ $# -lt 2 ] && printf "Missing arguments\n" && return 1
1266-
id_share_id="${1}" share_email_share_id="${2}" role_share_id="reader" type_share_id="${share_email_share_id:+user}"
1266+
id_share_id="${1}" role_share_id="${2:?Missing role}" share_email_share_id="${3}" role_share_id="reader" type_share_id="${share_email_share_id:+user}"
12671267
unset post_data_share_id response_share_id
12681268
12691269
"${EXTRA_LOG}" "justify" "Sharing.." "-" 1>&2
@@ -1480,6 +1480,11 @@ Options:\n
14801480
Note: For files inside folders, use --description-all flag.\n
14811481
-d | --skip-duplicates - Do not upload the files with the same name, if already present in the root folder/input folder, also works with recursive folders.\n
14821482
-S | --share <optional_email_address>- Share the uploaded input file/folder, grant reader permission to provided email address or to everyone with the shareable link.\n
1483+
-SM | -sm | --share-mode 'share mode' - Specify the share mode for sharing file.\n
1484+
Share modes are: r / reader - Read only permission.\n
1485+
: w / writer - Read and write permission.\n
1486+
: c / commenter - Comment only permission.\n
1487+
Note: Although this flag is independent of --share flag but when email is needed, then --share flag use is neccessary.\n
14831488
--speed 'speed' - Limit the download speed, supported formats: 1K, 1M and 1G.\n
14841489
-i | --save-info <file_to_save_info> - Save uploaded files info to the given filename.\n
14851490
-z | --config <config_path> - Override default config file with custom config file.\nIf you want to change default value, then use this format -z/--config default=default=your_config_file_path.\n
@@ -1574,7 +1579,7 @@ _setup_arguments() {
15741579
# De-initialize if any variables set already.
15751580
unset LIST_ACCOUNTS UPDATE_DEFAULT_ACCOUNT CUSTOM_ACCOUNT_NAME NEW_ACCOUNT_NAME DELETE_ACCOUNT_NAME ACCOUNT_ONLY_RUN
15761581
unset FOLDERNAME FINAL_LOCAL_INPUT_ARRAY FINAL_ID_INPUT_ARRAY CONTINUE_WITH_NO_INPUT
1577-
unset PARALLEL NO_OF_PARALLEL_JOBS SHARE SHARE_EMAIL OVERWRITE SKIP_DUPLICATES SKIP_SUBDIRS DESCRIPTION ROOTDIR QUIET
1582+
unset PARALLEL NO_OF_PARALLEL_JOBS SHARE SHARE_EMAIL SHARE_ROLE OVERWRITE SKIP_DUPLICATES SKIP_SUBDIRS DESCRIPTION ROOTDIR QUIET
15781583
unset VERBOSE VERBOSE_PROGRESS DEBUG LOG_FILE_ID CURL_SPEED RETRY
15791584
export CURL_PROGRESS="-s" EXTRA_LOG=":" CURL_PROGRESS_EXTRA="-s"
15801585
INFO_PATH="${HOME}/.google-drive-upload" CONFIG_INFO="${INFO_PATH}/google-drive-upload.configpath"
@@ -1683,6 +1688,21 @@ _setup_arguments() {
16831688
fi
16841689
;;
16851690
esac
1691+
SHARE_ROLE="${SHARE_ROLE:-reader}"
1692+
;;
1693+
-[Ss][Mm] | --share-mode)
1694+
_check_longoptions "${1}" "${2}"
1695+
case "${2}" in
1696+
r | read*) SHARE_ROLE="reader" ;;
1697+
w | write*) SHARE_ROLE="writer" ;;
1698+
c | comment*) SHARE_ROLE="commenter" ;;
1699+
*)
1700+
printf "%s\n" "Invalid share mode given ( ${2} ). Supported values are r or reader / w or writer / c or commenter." &&
1701+
exit 1
1702+
;;
1703+
esac
1704+
SHARE="_share_id"
1705+
shift
16861706
;;
16871707
--speed)
16881708
_check_longoptions "${1}" "${2}"
@@ -1869,7 +1889,7 @@ _setup_workspace() {
18691889
# WORKSPACE_FOLDER_ID, UPLOAD_MODE, SKIP_DUPLICATES, OVERWRITE, SHARE,
18701890
# UPLOAD_STATUS, COLUMNS, API_URL, API_VERSION, TOKEN_URL, LOG_FILE_ID
18711891
# FILE_ID, FILE_LINK, FINAL_ID_INPUT_ARRAY ( array )
1872-
# PARALLEL_UPLOAD, QUIET, NO_OF_PARALLEL_JOBS, TMPFILE
1892+
# PARALLEL_UPLOAD, QUIET, NO_OF_PARALLEL_JOBS, TMPFILE, SHARE_ROLE
18731893
# Functions - _print_center, _clear_line, _newline, _support_ansi_escapes, _print_center_quiet
18741894
# _upload_file, _share_id, _is_terminal, _dirname,
18751895
# _create_directory, _json_value, _url_encode, _check_existing_file, _bytes_to_human
@@ -1881,9 +1901,9 @@ _process_arguments() {
18811901
export SOURCE_UTILS
18821902
# on successful uploads
18831903
_share_and_print_link() {
1884-
"${SHARE:-:}" "${1:-}" "${SHARE_EMAIL}"
1904+
"${SHARE:-:}" "${1:-}" "${SHARE_ROLE}" "${SHARE_EMAIL}"
18851905
[ -z "${HIDE_INFO}" ] && {
1886-
_print_center "justify" "DriveLink" "${SHARE:+ (SHARED)}" "-"
1906+
_print_center "justify" "DriveLink" "${SHARE:+ (SHARED[$(printf "%.1s" "${SHARE_ROLE}")])}" "-"
18871907
_support_ansi_escapes && [ "$((COLUMNS))" -gt 45 ] 2>| /dev/null && _print_center "normal" '^ ^ ^' ' '
18881908
"${QUIET:-_print_center}" "normal" "https://drive.google.com/open?id=${1:-}" " "
18891909
}

sh/upload.sh

+24-4
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,11 @@ Options:\n
2828
Note: For files inside folders, use --description-all flag.\n
2929
-d | --skip-duplicates - Do not upload the files with the same name, if already present in the root folder/input folder, also works with recursive folders.\n
3030
-S | --share <optional_email_address>- Share the uploaded input file/folder, grant reader permission to provided email address or to everyone with the shareable link.\n
31+
-SM | -sm | --share-mode 'share mode' - Specify the share mode for sharing file.\n
32+
Share modes are: r / reader - Read only permission.\n
33+
: w / writer - Read and write permission.\n
34+
: c / commenter - Comment only permission.\n
35+
Note: Although this flag is independent of --share flag but when email is needed, then --share flag use is neccessary.\n
3136
--speed 'speed' - Limit the download speed, supported formats: 1K, 1M and 1G.\n
3237
-i | --save-info <file_to_save_info> - Save uploaded files info to the given filename.\n
3338
-z | --config <config_path> - Override default config file with custom config file.\nIf you want to change default value, then use this format -z/--config default=default=your_config_file_path.\n
@@ -122,7 +127,7 @@ _setup_arguments() {
122127
# De-initialize if any variables set already.
123128
unset LIST_ACCOUNTS UPDATE_DEFAULT_ACCOUNT CUSTOM_ACCOUNT_NAME NEW_ACCOUNT_NAME DELETE_ACCOUNT_NAME ACCOUNT_ONLY_RUN
124129
unset FOLDERNAME FINAL_LOCAL_INPUT_ARRAY FINAL_ID_INPUT_ARRAY CONTINUE_WITH_NO_INPUT
125-
unset PARALLEL NO_OF_PARALLEL_JOBS SHARE SHARE_EMAIL OVERWRITE SKIP_DUPLICATES SKIP_SUBDIRS DESCRIPTION ROOTDIR QUIET
130+
unset PARALLEL NO_OF_PARALLEL_JOBS SHARE SHARE_EMAIL SHARE_ROLE OVERWRITE SKIP_DUPLICATES SKIP_SUBDIRS DESCRIPTION ROOTDIR QUIET
126131
unset VERBOSE VERBOSE_PROGRESS DEBUG LOG_FILE_ID CURL_SPEED RETRY
127132
export CURL_PROGRESS="-s" EXTRA_LOG=":" CURL_PROGRESS_EXTRA="-s"
128133
INFO_PATH="${HOME}/.google-drive-upload" CONFIG_INFO="${INFO_PATH}/google-drive-upload.configpath"
@@ -231,6 +236,21 @@ _setup_arguments() {
231236
fi
232237
;;
233238
esac
239+
SHARE_ROLE="${SHARE_ROLE:-reader}"
240+
;;
241+
-[Ss][Mm] | --share-mode)
242+
_check_longoptions "${1}" "${2}"
243+
case "${2}" in
244+
r | read*) SHARE_ROLE="reader" ;;
245+
w | write*) SHARE_ROLE="writer" ;;
246+
c | comment*) SHARE_ROLE="commenter" ;;
247+
*)
248+
printf "%s\n" "Invalid share mode given ( ${2} ). Supported values are r or reader / w or writer / c or commenter." &&
249+
exit 1
250+
;;
251+
esac
252+
SHARE="_share_id"
253+
shift
234254
;;
235255
--speed)
236256
_check_longoptions "${1}" "${2}"
@@ -417,7 +437,7 @@ _setup_workspace() {
417437
# WORKSPACE_FOLDER_ID, UPLOAD_MODE, SKIP_DUPLICATES, OVERWRITE, SHARE,
418438
# UPLOAD_STATUS, COLUMNS, API_URL, API_VERSION, TOKEN_URL, LOG_FILE_ID
419439
# FILE_ID, FILE_LINK, FINAL_ID_INPUT_ARRAY ( array )
420-
# PARALLEL_UPLOAD, QUIET, NO_OF_PARALLEL_JOBS, TMPFILE
440+
# PARALLEL_UPLOAD, QUIET, NO_OF_PARALLEL_JOBS, TMPFILE, SHARE_ROLE
421441
# Functions - _print_center, _clear_line, _newline, _support_ansi_escapes, _print_center_quiet
422442
# _upload_file, _share_id, _is_terminal, _dirname,
423443
# _create_directory, _json_value, _url_encode, _check_existing_file, _bytes_to_human
@@ -429,9 +449,9 @@ _process_arguments() {
429449
export SOURCE_UTILS
430450
# on successful uploads
431451
_share_and_print_link() {
432-
"${SHARE:-:}" "${1:-}" "${SHARE_EMAIL}"
452+
"${SHARE:-:}" "${1:-}" "${SHARE_ROLE}" "${SHARE_EMAIL}"
433453
[ -z "${HIDE_INFO}" ] && {
434-
_print_center "justify" "DriveLink" "${SHARE:+ (SHARED)}" "-"
454+
_print_center "justify" "DriveLink" "${SHARE:+ (SHARED[$(printf "%.1s" "${SHARE_ROLE}")])}" "-"
435455
_support_ansi_escapes && [ "$((COLUMNS))" -gt 45 ] 2>| /dev/null && _print_center "normal" '^ ^ ^' ' '
436456
"${QUIET:-_print_center}" "normal" "https://drive.google.com/open?id=${1:-}" " "
437457
}

0 commit comments

Comments
 (0)