Skip to content

Commit

Permalink
feat: Remove attach from bash completion script
Browse files Browse the repository at this point in the history
* Card ID: CCT-425
* Attach command was removed from bash complition script as well
  --auto-attach CLI option and --autosubscribe from register
  command
  • Loading branch information
jirihnidek committed Jun 19, 2024
1 parent 717e92e commit b667da0
Showing 1 changed file with 2 additions and 23 deletions.
25 changes: 2 additions & 23 deletions etc-conf/subscription-manager.completion.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,23 +16,6 @@ _subscription_manager_auto_attach()
COMPREPLY=($(compgen -W "${opts}" -- ${1}))
}

_subscription_manager_attach()
{
# try to autocomplete pool id's as well
# doesn't work well with sudo/non root users though
case $prev in
--pool)
# wee bit of a hack to handle that we can't actually run subscription-manager list --available unless
# we are root. try it directly (as opposed to userhelper links) and if it fails,ignore it
POOLS=$(LANG=C /usr/sbin/subscription-manager list --available 2>/dev/null | sed -ne "s|Pool ID:\s*\(\S*\)|\1|p" )
COMPREPLY=($(compgen -W "${POOLS}" -- ${1}))
return 0
esac
local opts="--auto --pool --quantity --servicelevel --file
${_subscription_manager_common_opts}"
COMPREPLY=($(compgen -W "${opts}" -- ${1}))
}

_subscription_manager_syspurpose()
{
local opts="addons role service-level usage --show ${_subscription_manager_common_opts}"
Expand Down Expand Up @@ -203,7 +186,7 @@ _subscription_manager_refresh()

_subscription_manager_register()
{
local opts="--activationkey --auto-attach --autosubscribe --baseurl --consumerid
local opts="--activationkey --baseurl --consumerid
--environments --force --name --org --password --release
--servicelevel --username --token
${_subscription_manager_common_url_opts}
Expand Down Expand Up @@ -268,7 +251,7 @@ _subscription_manager()
done

# top-level commands and options
opts="addons attach auto-attach clean config environments facts identity import list orgs
opts="addons auto-attach clean config environments facts identity import list orgs
repo-override plugins redeem refresh register release remove repos role service-level status
syspurpose unregister usage version ${_subscription_manager_help_opts}"

Expand Down Expand Up @@ -301,10 +284,6 @@ _subscription_manager()
"_subscription_manager_service_level" "${cur}" "${prev}"
return 0
;;
attach)
"_subscription_manager_attach" "${cur}" "${prev}"
return 0
;;
remove)
"_subscription_manager_remove" "${cur}" "${prev}"
return 0
Expand Down

0 comments on commit b667da0

Please sign in to comment.