Bug 53824 - Добавьте утилите control bash-автодополнение
Summary: Добавьте утилите control bash-автодополнение
Status: UNCONFIRMED
Alias: None
Product: Sisyphus
Classification: Development
Component: control (show other bugs)
Version: unstable
Hardware: all Linux
: P5 enhancement
Assignee: Dmitry V. Levin
QA Contact: qa-sisyphus
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-04-11 19:56 MSK by LinInstr
Modified: 2025-04-14 08:44 MSK (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description LinInstr 2025-04-11 19:56:39 MSK
Надо добавить файл /etc/bash_completion.d/control со следующим содержанием:
function _control()
{
  latest="${COMP_WORDS[$COMP_CWORD]}"
  prev="${COMP_WORDS[$COMP_CWORD - 1]}"
  words=""
 
  case "${prev}" in
    control) words="$(ls /etc/control.d/facilities/)" ;;
    *)       words="$([ -f "/etc/control.d/facilities/$prev" ] && {
            control "$prev" list;
            echo help status 
    }; )" ;;
  esac
 
  COMPREPLY=($(compgen -W "$words" -- $latest))
  return 0
}
 
complete -F _control control
Comment 1 LinInstr 2025-04-11 19:57:41 MSK
Надо добавить в пакет файл /etc/bash_completion.d/control со следующим содержанием:
function _control()
{
  latest="${COMP_WORDS[$COMP_CWORD]}"
  prev="${COMP_WORDS[$COMP_CWORD - 1]}"
  words=""
 
  case "${prev}" in
    control) words="$(ls /etc/control.d/facilities/)" ;;
    *)       words="$([ -f "/etc/control.d/facilities/$prev" ] && {
            control "$prev" list;
            echo help status 
    }; )" ;;
  esac
 
  COMPREPLY=($(compgen -W "$words" -- $latest))
  return 0
}
 
complete -F _control control