mirror of
https://github.com/abraunegg/onedrive
synced 2024-06-29 10:50:30 +02:00
58d40c5174
* This change is to create an argument version of the config operation_timeout. There are many times where one may need to temporarily increase the timeout for an operation of a single large file that takes longer than the configured timeout. The command line argument is an excellent way to override the default or 'config' set option if required.
43 lines
1.4 KiB
Bash
43 lines
1.4 KiB
Bash
#!/bin/bash
|
|
#
|
|
# BASH completion code for OneDrive Linux Client
|
|
# (c) 2019 Norbert Preining
|
|
# License: GPLv3+ (as with the rest of the OneDrive Linux client project)
|
|
|
|
_onedrive()
|
|
{
|
|
local cur prev
|
|
|
|
COMPREPLY=()
|
|
cur=${COMP_WORDS[COMP_CWORD]}
|
|
prev=${COMP_WORDS[COMP_CWORD-1]}
|
|
|
|
options='--check-for-nomount --check-for-nosync --debug-https --disable-notifications --display-config --display-sync-status --download-only --disable-upload-validation --dry-run --enable-logging --force-http-1.1 --force-http-2 --local-first --logout -m --monitor --no-remote-delete --print-token --resync --skip-dot-files --skip-symlinks --synchronize --upload-only -v --verbose --version -h --help'
|
|
argopts='--create-directory --get-O365-drive-id --operation-timeout --remove-directory --single-directory --source-directory'
|
|
|
|
# Loop on the arguments to manage conflicting options
|
|
for (( i=0; i < ${#COMP_WORDS[@]}-1; i++ )); do
|
|
#exclude some mutually exclusive options
|
|
[[ ${COMP_WORDS[i]} == '--synchronize' ]] && options=${options/--monitor}
|
|
[[ ${COMP_WORDS[i]} == '--monitor' ]] && options=${options/--synchronize}
|
|
done
|
|
|
|
case "$prev" in
|
|
--confdir|--syncdir)
|
|
_filedir
|
|
return 0
|
|
;;
|
|
--create-directory|--get-O365-drive-id|--operation-timeout|--remove-directory|--single-directory|--source-directory)
|
|
return 0
|
|
;;
|
|
*)
|
|
COMPREPLY=( $( compgen -W "$options $argopts" -- "$cur"))
|
|
return 0
|
|
;;
|
|
esac
|
|
|
|
# notreached
|
|
return 0
|
|
}
|
|
complete -F _onedrive onedrive
|