-
Notifications
You must be signed in to change notification settings - Fork 22
/
uno_ampl-completion.bash
executable file
·49 lines (46 loc) · 1.57 KB
/
uno_ampl-completion.bash
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
#/usr/bin/env bash
_uno_ampl_completions()
{
local cur prev opts base
cur="${COMP_WORDS[COMP_CWORD]}"
prev="${COMP_WORDS[COMP_CWORD-1]}"
# The basic options to complete.
opts="-globalization_mechanism -globalization_strategy -constraint_relaxation_strategy -subproblem -preset"
# Complete the arguments to some of the basic commands.
case "${prev}" in
-globalization_mechanism)
local globalization_mechanisms="TR LS"
COMPREPLY=( $(compgen -W "${globalization_mechanisms}" -- ${cur}) )
return 0
;;
-globalization_strategy)
local globalization_strategies="l1_merit fletcher_filter_method waechter_filter_method funnel_method"
COMPREPLY=( $(compgen -W "${globalization_strategies}" -- ${cur}) )
return 0
;;
-constraint_relaxation_strategy)
local constraint_relaxation_strategies="feasibility_restoration l1_relaxation"
COMPREPLY=( $(compgen -W "${constraint_relaxation_strategies}" -- ${cur}) )
return 0
;;
-subproblem)
local subproblems="QP LP primal_dual_interior_point"
COMPREPLY=( $(compgen -W "${subproblems}" -- ${cur}) )
return 0
;;
-preset)
local presets="filtersqp ipopt byrd funnelsqp"
COMPREPLY=( $(compgen -W "${presets}" -- ${cur}) )
return 0
;;
*)
;;
esac
if [[ ${cur} == -* ]] ; then
COMPREPLY=($(compgen -W "${opts}" -- ${cur}))
return 0
else
_filedir
fi
}
complete -F _uno_ampl_completions uno_ampl