Merge lp:~derek-name/openvista-gtm-integration/bug646483 into lp:openvista-gtm-integration

Proposed by Derek_
Status: Merged
Merged at revision: 140
Proposed branch: lp:~derek-name/openvista-gtm-integration/bug646483
Merge into: lp:openvista-gtm-integration
Diff against target: 168 lines (+56/-27)
2 files modified
docs/man8/ovinstanceadd.8 (+5/-0)
scripts/etc/bash_completion.d/openvista (+51/-27)
To merge this branch: bzr merge lp:~derek-name/openvista-gtm-integration/bug646483
Reviewer Review Type Date Requested Status
Jon Tai Approve
Review via email: mp+36573@code.launchpad.net
To post a comment you must log in.
142. By Derek_

ovinstanceadd.8 (man page): Describe the -p option.

143. By Derek_

Fix typo and use defined variable in ovinstanceadd bash completion.

Revision history for this message
Jon Tai (jontai) :
review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'docs/man8/ovinstanceadd.8'
2--- docs/man8/ovinstanceadd.8 2010-09-23 21:43:57 +0000
3+++ docs/man8/ovinstanceadd.8 2010-09-24 19:22:50 +0000
4@@ -18,6 +18,11 @@
5 database files, creates default configuration files, generates an SSH key for
6 the instance, sets up an ssh forced command to run ^ZU in the instance, and
7 creates the webdav root for the instance.
8+.PP
9+By default, ovinstanceadd sets up the new instance to use the latest version of
10+GT.M installed on the system. You can specify an alternate path to a GT.M
11+installation with the -p flag. The -p flag was added in \fBovinstanceadd\fR
12+0.8.10.
13 .SH OPTIONS
14 .IP -p
15 path; value of $gtm_dist for this instance
16
17=== modified file 'scripts/etc/bash_completion.d/openvista'
18--- scripts/etc/bash_completion.d/openvista 2010-02-11 18:50:29 +0000
19+++ scripts/etc/bash_completion.d/openvista 2010-09-24 19:22:50 +0000
20@@ -6,16 +6,16 @@
21 # This program is free software; you can redistribute it and/or modify it solely
22 # under the terms of the GNU Affero General Public License version 3 as published
23 # by the Free Software Foundation.
24-#
25+#
26 # This program is distributed in the hope that it will be useful, but WITHOUT
27 # ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
28 # FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License
29 # for more details.
30-#
31+#
32 # You should have received a copy of the GNU Affero General Public License
33 # along with this program. If not, see <http://www.gnu.org/licenses>.
34-#
35-# You can contact Medsphere Systems Corporation headquarters at 1917 Palomar
36+#
37+# You can contact Medsphere Systems Corporation headquarters at 1917 Palomar
38 # Oaks Way, Suite 200, Carlsbad, CA 92008 or at legal@medsphere.com.
39
40
41@@ -27,8 +27,8 @@
42 COMPREPLY=()
43
44 for i in `seq $COMP_CWORD`; do
45- # we've run out of the allowed number of non-option arguments; perform
46- # no further completion
47+ # we've run out of the allowed number of non-option arguments; perform
48+ # no further completion
49 if [ $allowed_nonopt_words -eq 0 ]; then
50 return
51 fi
52@@ -37,9 +37,9 @@
53 -*)
54 # if one of the arguments so far is -h or -V, perform no further completion
55 if [ x"${COMP_WORDS[i]}" = x"-h" ] || [ x"${COMP_WORDS[i]}" = x"-V" ]; then
56- # if we just return here, -h won't complete the space
57- # afterward; use a hack to exit on the next iteration of
58- # the loop
59+ # if we just return here, -h won't complete the space
60+ # afterward; use a hack to exit on the next iteration of
61+ # the loop
62 allowed_nonopt_words=0
63 fi
64 ;;
65@@ -112,23 +112,47 @@
66
67 complete -F _ovrestore $filenames ovrestore
68
69-# ovinstanceadd [-h] [-V] NEW_INSTANCE_NAME
70+# ovinstanceadd [-h] [-V] [-p path] NEW_INSTANCE_NAME
71 _ovinstanceadd()
72 {
73+ opts='-h -V -p'
74+ allowed_nonopt_words=1
75+
76 COMPREPLY=()
77
78- if [ $COMP_CWORD -gt 1 ]; then
79- return
80- fi
81-
82- case ${COMP_WORDS[COMP_CWORD]} in
83+ for i in $(seq $COMP_CWORD); do
84+ [[ "$allowed_nonopt_words" == 0 ]] && return
85+ case ${COMP_WORDS[i]} in
86+ -*)
87+ if [[ "${COMP_WORDS[i]}" == "-h" ]] \
88+ || [[ "${COMP_WORDS[i]}" == "-V" ]]; then
89+ allowed_nonopt_words=0
90+ elif [[ "${COMP_WORDS[i]}" == "-p" ]]; then
91+ allowed_nonopt_words=$(( $allowed_nonopt_words + 1 ))
92+ fi
93+ ;;
94+ *)
95+ allowed_nonopt_words=$(( $allowed_nonopt_words - 1 ))
96+ ;;
97+ esac
98+ done
99+
100+ cur=${COMP_WORDS[COMP_CWORD]}
101+ prev=${COMP_WORDS[COMP_CWORD-1]}
102+
103+ case $cur in
104 -*)
105- COMPREPLY=( $(compgen -W "-h -V" -- ${COMP_WORDS[COMP_CWORD]}) )
106+ COMPREPLY=( $(compgen -W "$opts" -- $cur) )
107+ ;;
108+ *)
109+ if [[ "$prev" == "-p" ]]; then
110+ _filedir
111+ fi
112 ;;
113 esac
114 }
115
116-complete -F _ovinstanceadd ovinstanceadd
117+complete -F _ovinstanceadd $filenames ovinstanceadd
118
119 # ovimport [-h] [-V] [-q] [-f] [-t target] [-c imported|all|none] [-r] ROUTINES [-g] GLOBALS INSTANCE_NAME
120 _ovimport()
121@@ -139,8 +163,8 @@
122 COMPREPLY=()
123
124 for i in `seq $COMP_CWORD`; do
125- # we've run out of the allowed number of non-option arguments; perform
126- # no further completion
127+ # we've run out of the allowed number of non-option arguments; perform
128+ # no further completion
129 if [ $allowed_nonopt_words -eq 0 ]; then
130 return
131 fi
132@@ -149,9 +173,9 @@
133 -*)
134 # if one of the arguments so far is -h or -V, perform no further completion
135 if [ x"${COMP_WORDS[i]}" = x"-h" ] || [ x"${COMP_WORDS[i]}" = x"-V" ]; then
136- # if we just return here, -h won't complete the space
137- # afterward; use a hack to exit on the next iteration of
138- # the loop
139+ # if we just return here, -h won't complete the space
140+ # afterward; use a hack to exit on the next iteration of
141+ # the loop
142 allowed_nonopt_words=0
143 elif [ x"${COMP_WORDS[i]}" = x"-t" ] || [ x"${COMP_WORDS[i]}" = x"-c" ] || [ x"${COMP_WORDS[i]}" = x"-r" ] || [ x"${COMP_WORDS[i]}" = x"-g" ]; then
144 allowed_nonopt_words=`expr $allowed_nonopt_words + 1`
145@@ -196,8 +220,8 @@
146 COMPREPLY=()
147
148 for i in `seq $COMP_CWORD`; do
149- # we've run out of the allowed number of non-option arguments; perform
150- # no further completion
151+ # we've run out of the allowed number of non-option arguments; perform
152+ # no further completion
153 if [ $allowed_nonopt_words -eq 0 ]; then
154 return
155 fi
156@@ -206,9 +230,9 @@
157 -*)
158 # if one of the arguments so far is -h or -V, perform no further completion
159 if [ x"${COMP_WORDS[i]}" = x"-h" ] || [ x"${COMP_WORDS[i]}" = x"-V" ]; then
160- # if we just return here, -h won't complete the space
161- # afterward; use a hack to exit on the next iteration of
162- # the loop
163+ # if we just return here, -h won't complete the space
164+ # afterward; use a hack to exit on the next iteration of
165+ # the loop
166 allowed_nonopt_words=0
167 fi
168 ;;

Subscribers

People subscribed via source and target branches