File tree Expand file tree Collapse file tree 5 files changed +41
-60
lines changed
Expand file tree Collapse file tree 5 files changed +41
-60
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change 1+ utils/completion/python-opensips
Original file line number Diff line number Diff line change @@ -43,6 +43,7 @@ XMLRPC Interface.
4343
4444%install
4545%py3_install
46+ install -Dpm 0644 utils/completion/python-opensips -t %{buildroot }%{bash_completions_dir }
4647
4748%clean
4849rm -rf $RPM_BUILD_ROOT
@@ -55,6 +56,7 @@ rm -rf $RPM_BUILD_ROOT
5556%doc README.md
5657%doc docs/*
5758%license LICENSE
59+ %{bash_completions_dir }/python-opensips
5860
5961%changelog
6062* Tue Nov 19 2024 Razvan Crainea <razvan@opensips.org> - 0.1.3-3
Original file line number Diff line number Diff line change 4242 "License :: OSI Approved :: GNU General Public License v3 (GPLv3)" ,
4343 "Operating System :: OS Independent" ,
4444 ],
45- entry_points = {
45+ entry_points = {
4646 'console_scripts' : [
4747 'opensips-mi = opensips.mi.__main__:main' ,
4848 'opensips-event = opensips.event.__main__:main' ,
4949 ],
5050 },
51+ data_files = [
52+ ("share/bash_completion/completions/" ,
53+ ["utils/completion/python-opensips" ])
54+ ],
55+ package_data = {
56+ "" : ["utils/completion/python-opensips" ]
57+ },
58+ include_package_data = True ,
5159 python_requires = ">=3.6"
5260)
Original file line number Diff line number Diff line change 1+ function _opensips-complete() {
2+ local cur prev opts completed_args
3+ COMPREPLY=()
4+
5+ cur="${COMP_WORDS[COMP_CWORD]}"
6+
7+ prev="${COMP_WORDS[COMP_CWORD-1]}"
8+
9+ completed_args=""
10+ if [[ "${prev:0:1}" != "-" ]]; then
11+ if [[ $COMP_CWORD -ge 2 ]]; then
12+ completed_args="${COMP_WORDS[@]:1:COMP_CWORD-2}"
13+ if [[ "${COMP_WORDS[COMP_CWORD-2]:0:1}" == "-" ]]; then
14+ completed_args="$completed_args $prev"
15+ fi
16+ fi
17+ opts="$($1 $completed_args -bc)"
18+ else
19+ while [[ "${prev:0:1}" == "-" ]]; do
20+ prev="${prev:1}"
21+ done
22+ completed_args="${COMP_WORDS[@]:1:COMP_CWORD-2}"
23+ opts="$($1 -bc $prev)"
24+ fi
25+
26+ COMPREPLY=( $(compgen -W "$opts" -- "$cur") )
27+ }
28+
29+ complete -F _opensips-complete opensips-mi opensips-event
You can’t perform that action at this time.
0 commit comments