Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fapi: Fix consistency of tss2_* tools #1

Merged
merged 2 commits into from
Jan 28, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions dist/bash-completion/tpm2-tools/tss2_authorizepolicy
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ _tss2_authorizepolicy()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)[pkr] | --policyPath | --keyPath | --policyRef)
-!(-*)[r] | --policyRef)
_filedir
COMPREPLY+=( '-' )
return;;
-!(-*)[Pp] | --policyPath | --keyPath )
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --policyPath= -p
--keyPath= -k --policyRef= -r" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --policyPath -P
--keyPath -p --policyRef -r" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_authorizepolicy tss2_authorizepolicy
Expand Down
4 changes: 2 additions & 2 deletions dist/bash-completion/tpm2-tools/tss2_changeauth
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ _tss2_changeauth()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)[ae] | --authValue | --entityPath)
-!(-*)[ap] | --authValue | --entityPath)
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version -f --force -a --authValue
-e --entityPath=" -- "$cur") )
-p --entityPath" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_changeauth tss2_changeauth
Expand Down
6 changes: 3 additions & 3 deletions dist/bash-completion/tpm2-tools/tss2_createkey
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ _tss2_createkey()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)[ptla] | --path | --type | --policyPath | --authValue)
-!(-*)[ptPa] | --path | --type | --policyPath | --authValue)
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version -p --path= -t --type=
-l --policyPath= -a --authValue" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version -p --path -t --type
-P --policyPath -a --authValue" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_createkey tss2_createkey
Expand Down
9 changes: 3 additions & 6 deletions dist/bash-completion/tpm2-tools/tss2_createnv
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,14 @@ _tss2_createnv()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)t | --type)
COMPREPLY+=( '-' )
return;;
-!(-*)[psPa] | --path | --size |--policyPath | --authValue)
-!(-*)[stpPa] | --size | --type | --path | --policyPath | --authValue)
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version -P --policy-path=
-p --path= -s --size= -t --type= -a --authValue" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version -P --policyPath
-p --path -s --size -t --type -a --authValue" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_createnv tss2_createnv
Expand Down
8 changes: 6 additions & 2 deletions dist/bash-completion/tpm2-tools/tss2_createseal
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,17 @@ _tss2_createseal()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)[ptPad] | --path | --type | --policyPath | --authValue | --data)
-!(-*)[i] | --data)
_filedir
COMPREPLY+=( '-' )
return;;
-!(-*)[ptPa] | --path | --type | --policyPath | --authValue)
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --password -a --path= -p --policyPath= -P --type= -t --data= -d" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --authValue -a --path -p --policyPath -P --type -t --data -i" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_createseal tss2_createseal
Expand Down
6 changes: 4 additions & 2 deletions dist/bash-completion/tpm2-tools/tss2_decrypt
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,17 @@ _tss2_decrypt()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)[kpc] | --keyPath | --plainText | --cipherText)
-!(-*)[io] | --cipherText | --plainText)
_filedir
COMPREPLY+=( '-' )
return;;
-!(-*)p | --keyPath)
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --force -f -c --cipherText= --plainText= -p --keyPath= -k" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --force -f -i --cipherText --plainText -o --keyPath -p" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_decrypt tss2_decrypt
Expand Down
3 changes: 1 addition & 2 deletions dist/bash-completion/tpm2-tools/tss2_delete
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,12 @@ _tss2_delete()
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)p | --path)
COMPREPLY=( $(compgen -W "$(tss2_list --path=$cur)" -- $cur))
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version -p --path=" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version -p --path" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_delete tss2_delete
Expand Down
8 changes: 4 additions & 4 deletions dist/bash-completion/tpm2-tools/tss2_encrypt
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ _tss2_encrypt()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)[cP] | --cipherText | --plainText)
-!(-*)[io] | --plainText | --cipherText)
_filedir
COMPREPLY+=( '-' )
return;;
-!(-*)[kp] | --keyPath | --policyPath)
-!(-*)[pP] | --keyPath | --policyPath)
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --force -f --cipherText= -c
--keyPath= k --policyPath= -p --plainText= -P" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version -f --force -o --cipherText
-p --keyPath -P --policyPath -i --plainText" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_encrypt tss2_encrypt
Expand Down
6 changes: 3 additions & 3 deletions dist/bash-completion/tpm2-tools/tss2_exportkey
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ _tss2_exportkey()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)e | --exportedData)
-!(-*)[o] | --exportedData )
_filedir
COMPREPLY+=( '-' )
return;;
-!(-*)[pP] | --pathOfKeyToDuplicate | --pathToPublicKeyOfNewParent)
-!(-*)[pe] | --pathOfKeyToDuplicate | --pathToPublicKeyOfNewParent)
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --exportedData= -e --force -f --pathOfKeyToDuplicate= -p --pathToPublicKeyOfNewParent= -P" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --exportedData -o --force -f --pathOfKeyToDuplicate -p --pathToPublicKeyOfNewParent -e" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_exportkey tss2_exportkey
Expand Down
8 changes: 4 additions & 4 deletions dist/bash-completion/tpm2-tools/tss2_exportpolicy
Original file line number Diff line number Diff line change
Expand Up @@ -8,18 +8,18 @@ _tss2_exportpolicy()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)j | --jsonPolicy)
-!(-*)[o] | --jsonPolicy )
_filedir
COMPREPLY+=( '-' )
return;;
-!(-*)p | --path)
-!(-*)[p] | --path)
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --jsonPolicy= -j
--path= -p --force= -f" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --jsonPolicy -o
--path -p --force -f" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_exportpolicy tss2_exportpolicy
Expand Down
6 changes: 3 additions & 3 deletions dist/bash-completion/tpm2-tools/tss2_getappdata
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ _tss2_getappdata()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)a | --appData)
-!(-*)[o] | --appData)
_filedir
COMPREPLY+=( '-' )
return;;
-!(-*)p | --path)
-!(-*)[p] | --path)
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --force -f -p --path= --appData= -a" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --force -f -p --path --appData -o" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_getappdata tss2_getappdata
Expand Down
6 changes: 3 additions & 3 deletions dist/bash-completion/tpm2-tools/tss2_getcertificate
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ _tss2_getcertificate()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)x | --x509certData)
-!(-*)[o] | --x509certData)
_filedir
COMPREPLY+=( '-' )
return;;
-!(-*)p | --path)
-!(-*)[p] | --path)
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --force -f -p --path= --x509certData= -x" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --force -f -p --path --x509certData -o" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_getcertificate tss2_getcertificate
Expand Down
10 changes: 7 additions & 3 deletions dist/bash-completion/tpm2-tools/tss2_getdescription
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ _tss2_getdescription()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)[pd] | --path | --description)
-!(-*)[o] | --description)
COMPREPLY+=( '-' )
_filedir
return;;
-!(-*)[p] | --path)
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --path= -p
--description= -d " -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --path -p
--description -o " -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_getdescription tss2_getdescription
Expand Down
4 changes: 2 additions & 2 deletions dist/bash-completion/tpm2-tools/tss2_getinfo
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ _tss2_getinfo()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)i | --info)
-!(-*)o | --info)
_filedir
COMPREPLY+=( '-' )
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --force -f --info= -i" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --force -f --info -o" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_getinfo tss2_getinfo
Expand Down
4 changes: 2 additions & 2 deletions dist/bash-completion/tpm2-tools/tss2_getplatformcertificates
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,15 @@ _tss2_getplatformcertificates()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)c | --certificates)
-!(-*)o | --certificates)
_filedir
COMPREPLY+=( '-' )
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --force -f --certificates= -c" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --force -f --certificates -o" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_getplatformcertificates tss2_getplatformcertificates
Expand Down
4 changes: 2 additions & 2 deletions dist/bash-completion/tpm2-tools/tss2_getrandom
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ _tss2_getrandom()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)d | --data)
-!(-*)o | --data)
_filedir
COMPREPLY+=( '-' )
return;;
Expand All @@ -18,7 +18,7 @@ _tss2_getrandom()

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --force -f --numBytes= --data= -d -n" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --force -f --numBytes -n --data -o " -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_getrandom tss2_getrandom
Expand Down
16 changes: 3 additions & 13 deletions dist/bash-completion/tpm2-tools/tss2_gettpmblobs
Original file line number Diff line number Diff line change
Expand Up @@ -8,27 +8,17 @@ _tss2_gettpmblobs()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)p | --path)
_filedir
COMPREPLY+=( '-' )
return;;
-!(-*)u | --tpm2bPublic
_filedir
COMPREPLY+=( '-' )
return;;
-!(-*)r | --tpm2bPrivate
_filedir
COMPREPLY+=( '-' )
-!(-*)[p] | --path )
return;;
-!(-*)l | --policy
-!(-*)[url] | --tpm2bPublic | --tpm2bPrivate | --policy)
_filedir
COMPREPLY+=( '-' )
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --force -f --path= -p --tpm2bPublic= -u --tpm2bPrivate= -r --policy= -l" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --force -f --path -p --tpm2bPublic -u --tpm2bPrivate -r --policy -l" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_gettpmblobs tss2_gettpmblobs
Expand Down
8 changes: 4 additions & 4 deletions dist/bash-completion/tpm2-tools/tss2_import
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,17 @@ _tss2_import()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)d | --importData)
-!(-*)[p] | --path)
return;;
-!(-*)[i] | --importData)
_filedir
COMPREPLY+=( '-' )
return;;
-!(-*)p | --path)
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --importData= -d --path= -p" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --importData -i --path -p" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_import tss2_import
Expand Down
10 changes: 7 additions & 3 deletions dist/bash-completion/tpm2-tools/tss2_list
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,18 @@ _tss2_list()
-!(-*)h | --help)
COMPREPLY=( $(compgen -W "man no-man" -- "$cur") )
return;;
-!(-*)[ps] | --pathList | searchPath )
-!(-*)[p] | --searchPath)
return;;
-!(-*)[o] | --pathList)
_filedir
COMPREPLY+=( '-' )
return;;
esac

$split && return

COMPREPLY=( $(compgen -W "-h --help -v --version --pathList -p
--searchPath -s" -- "$cur") )
COMPREPLY=( $(compgen -W "-h --help -v --version --pathList -o
--searchPath -p" -- "$cur") )
[[ $COMPREPLY == *= ]] && compopt -o nospace
} &&
complete -F _tss2_list tss2_list
Expand Down
Loading