source: tags/confman-1.0/confmandoc.sh @ 78

Revision 78, 9.2 KB checked in by ccowart, 6 years ago (diff)

vim bugfix

Line 
1#! /bin/bash
2#
3# This is a confman shell library that provides usage and help information.
4# I wanted to get it out of the main script, cause it's really long. This also
5# makes modularizing the code (think foreign languages if this ever goes
6# public) (Hah!) in the future.
7#
8# Author: Chris Cowart <ccowart@rescomp.berkeley.edu>
9# Date: 14 April 2006
10#
11# $Id$
12
13function print_usage {
14cat <<EOF
15$MYNAME provides a command-line interface to Rescomp's server
16configuration management system.
17
18Usage:
19  $MYNAME [ help | -h | --help ] [ command ]
20  $MYNAME setup
21  $MYNAME update
22  $MYNAME commit
23  $MYNAME diff [ working_copy ]
24  $MYNAME log [ working_copy ]
25  $MYNAME create module
26  $MYNAME rmmod module
27  $MYNAME import module livefile
28  $MYNAME install workingfile [ workingfile ... ]
29  $MYNAME ls [ workingfile | workingdirectory ]
30  $MYNAME rm workingfile
31  $MYNAME cp src_working_copy dest_working_copy
32  $MYNAME mv src_working_copy dest_working_copy
33  $MYNAME mkdir workingdirectory
34  $MYNAME revert workingfile
35  $MYNAME chown owner [ workingfile | workingdirectory ]
36  $MYNAME chgrp group [ workingfile | workingdirectory ]
37  $MYNAME chmod mode  [ workingfile | workingdirectory ]
38  $MYNAME chcom comment-character [ workingfile | workingdirectory ]
39  $MYNAME checklook module
40  $MYNAME checknew module name
41  $MYNAME checkclear module name
42  $MYNAME rollback module [ checkpoint | YYYYMMDD [HHMM] ]
43
44For specific information on a particular $MYNAME subcommand, please run
45  $MYNAME help subcommand
46
47eg: $MYNAME help rollback
48
49EOF
50
51exit $1
52}
53
54function print_help {
55  case $1 in
56          se* )
57cat <<EOF
58$MYNAME provides a command-line interface to Rescomp's server
59configuration management system.
60
61Usage:
62  $MYNAME setup
63
64The setup command is intended to be run the first time you use $MYNAME.
65It will generate your working copy. setup takes no additional arguments.
66
67EOF
68;;
69          cr* )
70cat <<EOF
71$MYNAME provides a command-line interface to Rescomp's server
72configuration management system.
73
74Usage:
75  $MYNAME create module
76
77The create command will cause a new module, named module, to appear as a
78top-level-directory in your working copy. This change will also be made to
79the repositry at the same time.
80
81EOF
82;;
83          rmm* )
84cat <<EOF
85$MYNAME provides a command-line interface to Rescomp's server
86configuration management system.
87
88Usage:
89  $MYNAME rmmod module
90This command will delete the specified module from your working copy. Use with
91care.
92EOF
93;;
94          u* )
95cat <<EOF
96$MYNAME provides a command-line interface to Rescomp's server
97configuration management system.
98
99Usage:
100  $MYNAME update
101
102The update command will update your working copy of all the modules
103appearing in the current host's recipe file. This command does not alter
104the repository.
105
106EOF
107;;
108          d* )
109cat <<EOF
110$MYNAME provides a command-line interface to Rescomp's server
111configuration management system.
112
113Usage:
114  $MYNAME diff [ working_copy ]
115
116Look at the changes you've made to your working copy of a file or directory.
117EOF
118;;
119          lo* )
120cat <<EOF
121$MYNAME provides a command-line interface to Rescomp's server
122configuration management system.
123
124Usage:
125  $MYNAME log [ working_copy ]
126
127Look at the log entries for the file or directory specified by working_copy.
128EOF
129;;
130          st* )
131cat <<EOF
132$MYNAME provides a command-line interface to Rescomp's server
133configuration management system.
134
135Usage:
136  $MYNAME status [ working_copy ]
137
138Look at the status entries for the file or directory specified by working_copy.
139EOF
140;;
141          cp )
142cat <<EOF
143$MYNAME provides a command-line interface to Rescomp's server
144configuration management system.
145
146Usage:
147  $MYNAME cp src_working_copy dest_working_copy
148
149Copy source to destination. Arguments must be working copies.
150EOF
151;;
152          mv )
153cat <<EOF
154$MYNAME provides a command-line interface to Rescomp's server
155configuration management system.
156
157Usage:
158  $MYNAME mv src_working_copy dest_working_copy
159
160Move source to destination. Arguments must be working copies.
161EOF
162;;
163          co* )
164cat <<EOF
165$MYNAME provides a command-line interface to Rescomp's server
166configuration management system.
167
168Usage:
169  $MYNAME commit
170
171The commit command causes your changes to take effect. This means that
172first, your working copy of all of the modules in the current host's
173recipe will be committed to the repository. This happens after we've run
174a $MYNAME update to prevent out-of-date conflicts. If there are any
175conflicts that require human intervention, the command will fail and exit
176non-zero.
177
178Once $MYNAME is satisfied that all of your changes have been propogated to
179the repository, we will roll-out your working copy to the live filesystem.
180Every module appearing in the host's recipe file will be rolled out IN THE
181ORDER OF APPEARANCE.
182
183EOF
184;;
185          im* )
186cat <<EOF
187$MYNAME provides a command-line interface to Rescomp's server
188configuration management system.
189
190Usage:
191  $MYNAME import module livefile
192
193The import subcommand adds the specified file to your working copy of the
194repository.
195
196EOF
197;;
198          in* )
199cat <<EOF
200$MYNAME provides a command-line interface to Rescomp's server
201configuration management system.
202
203Usage:
204  $MYNAME install workingfile [ workingfile ... ]
205
206The install subcommand allows you to roll out a single file from your working
207copy.
208
209EOF
210;;
211          rev* )
212cat <<EOF
213$MYNAME provides a command-line interface to Rescomp's server
214configuration management system.
215
216Usage:
217  $MYNAME revert workingfile [ workingfile ... ]
218
219The revert subcommand gives you the opportunity to revert to the file before
220you started making changes to it.
221
222EOF
223;;
224          rm )
225cat <<EOF
226$MYNAME provides a command-line interface to Rescomp's server configuration
227management system.
228
229Usage:
230  $MYNAME rm file
231
232The remove subcommand removes a file from version control It will NOT remove
233the file from the live filesystem.
234
235EOF
236;;
237          mk* )
238cat <<EOF
239$MYNAME provides a command-line interface to Rescomp's server configuration
240management system.
241
242Usage:
243  $MYNAME mkdir directory
244
245This command will create a new version-controlled directory in your working
246copy.  Parent directories do not have to exist; they will be created
247automagically. This command only affects your working copy. It does not commit
248the change.
249
250EOF
251;;
252          ls )
253cat<<EOF
254$MYNAME provides a command-line interface to Rescomp's server configuration
255management system.
256
257Usage:
258  $MYNAME ls [ file | directory ]
259
260The ls subcommand lists out the contents, in modified long form, of the
261current working directory. If a file or directory is specified, it will list
262that instead.
263
264EOF
265;;
266          cho* )
267cat <<EOF
268$MYNAME provides a command-line interface to Rescomp's server configuration
269management system.
270
271Usage:
272  $MYNAME chown [ -R ] owner [ file | directory ]
273
274The chown command works like it's unix equivalent. It does not support
275user:group notation. The only option it will take is -R for recursive.
276
277EOF
278;;
279          chg* )
280cat <<EOF
281$MYNAME provides a command-line interface to Rescomp's server configuration
282management system.
283
284Usage:
285  $MYNAME chgrp group [ file | directory ]
286
287The chgrp command works like it's unix equivalent. The only option it will take
288is -R for recursive.
289
290EOF
291;;
292          chm* )
293cat <<EOF
294$MYNAME provides a command-line interface to Rescomp's server configuration
295management system.
296
297Usage:
298  $MYNAME chmod mode [ file | directory ]
299
300The chmod command works like it's unix equivalent. Note that it will only
301accept octets as permissions -- it will not interpret symbolic permissions
302correctly. The only option it will take is -R for recursive.
303
304EOF
305;;
306          chc* )
307cat <<EOF
308$MYNAME provides a command-line interface to Rescomp's server configuration
309management system.
310
311Usage:
312  $MYNAME chcom comment-character [ file | directory ]
313
314The chcom subcommand takes a file or directory as an argument and changes the
315comment string associated with it. This will typically only be useful when
316confman has guessed the comment character of your file incorrectly.
317
318EOF
319;;
320          checkl* )
321cat <<EOF
322$MYNAME provides a command-line interface to Rescomp's server
323configuration management system.
324
325Usage:
326  $MYNAME checklook module
327
328The checklook command peeks into the checkpoints for the specified module
329and gives you a listing of current checkpoints with some other cool info.
330This command does not alter the repository.
331
332EOF
333;;
334          checkn* )
335cat <<EOF
336$MYNAME provides a command-line interface to Rescomp's server
337configuration management system.
338
339Usage:
340  $MYNAME checknew module name
341
342The newcheck command creates a named checkpoint for the specified module.
343This change is committed to the repository immediately.
344
345EOF
346;;
347          checkc* )
348cat <<EOF
349$MYNAME provides a command-line interface to Rescomp's server
350configuration management system.
351
352Usage:
353  $MYNAME checkclear module name
354
355The rmcheck command clears a named checkpoint from the specified module.
356This change is committed to the repository immediately.
357
358EOF
359;;
360          ro* )
361cat <<EOF
362$MYNAME provides a command-line interface to Rescomp's server
363configuration management system.
364
365Usage:
366  $MYNAME rollback module [ checkpoint | YYYYMMDD [HHMM] ]
367
368The rollback command first rolls your working copy of module back to the
369named checkpoint. You can optionally roll-back to a specific point in time
370using a date (and optionally time) as specified in the usage statement.
371This change is immediately committed to the repository.
372
373After the rollback is complete, we perform the equivalent of a:
374  $MYNAME commit
375
376EOF
377;;
378          * )
379print_usage 1
380;;
381esac
382exit $2
383}
384
385
386
Note: See TracBrowser for help on using the repository browser.