source: tags/confman-1.5.6a1/confmandoc.sh @ 123

Revision 123, 11.6 KB checked in by ccowart, 5 years ago (diff)

Developed the pull mechanism for confman. It's ready to go into production!

  • Property svn:keywords set to Id
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 rename oldmodule newmodule
28  $MYNAME import module livefile
29  $MYNAME install workingfile [ workingfile ... ]
30  $MYNAME status [ working_copy ]
31  $MYNAME state
32  $MYNAME ls [ workingfile | workingdirectory ]
33  $MYNAME lsattr [ workingfile | workingdirectory ]
34  $MYNAME chattr attribute value [ workingfile | workingdirectory ]
35  $MYNAME rmattr attribute [ workingfile | workingdirectory ]
36  $MYNAME rm workingfile
37  $MYNAME cp src_working_copy dest_working_copy
38  $MYNAME mv src_working_copy dest_working_copy
39  $MYNAME mkdir workingdirectory
40  $MYNAME revert workingfile
41  $MYNAME chown owner [ workingfile | workingdirectory ]
42  $MYNAME chgrp group [ workingfile | workingdirectory ]
43  $MYNAME chmod mode  [ workingfile | workingdirectory ]
44  $MYNAME chcom comment-character [ workingfile | workingdirectory ]
45  $MYNAME checklook module
46  $MYNAME checknew module name
47  $MYNAME checkclear module name
48  $MYNAME rollback module [ checkpoint | YYYYMMDD [HHMM] ]
49
50For specific information on a particular $MYNAME subcommand, please run
51  $MYNAME help subcommand
52
53eg: $MYNAME help rollback
54
55EOF
56
57exit $1
58}
59
60function print_help {
61  case $1 in
62          se* )
63cat <<EOF
64$MYNAME provides a command-line interface to Rescomp's server
65configuration management system.
66
67Usage:
68  $MYNAME setup
69
70The setup command is intended to be run the first time you use $MYNAME.
71It will generate your working copy. setup takes no additional arguments.
72
73EOF
74;;
75          cr* )
76cat <<EOF
77$MYNAME provides a command-line interface to Rescomp's server
78configuration management system.
79
80Usage:
81  $MYNAME create module
82
83The create command will cause a new module, named module, to appear as a
84top-level-directory in your working copy. This change will also be made to
85the repositry at the same time.
86
87EOF
88;;
89          rmm* )
90cat <<EOF
91$MYNAME provides a command-line interface to Rescomp's server
92configuration management system.
93
94Usage:
95  $MYNAME rmmod module
96This command will delete the specified module from your working copy. Use with
97care.
98EOF
99;;
100          ren* )
101cat <<EOF
102$MYNAME provides a command-line interface to Rescomp's server
103configuration management system.
104
105Usage:
106  $MYNAME rename oldmodule newmodule
107
108Rename oldmoule to newmodule, updating all singularities, headers, and
109otherwise performing black magic.
110
111EOF
112;;
113          u* )
114cat <<EOF
115$MYNAME provides a command-line interface to Rescomp's server
116configuration management system.
117
118Usage:
119  $MYNAME update
120
121The update command will update your working copy of all the modules
122appearing in the current host's recipe file. This command does not alter
123the repository.
124
125EOF
126;;
127          d* )
128cat <<EOF
129$MYNAME provides a command-line interface to Rescomp's server
130configuration management system.
131
132Usage:
133  $MYNAME diff [ working_copy ]
134
135Look at the changes you've made to your working copy of a file or directory.
136EOF
137;;
138          lo* )
139cat <<EOF
140$MYNAME provides a command-line interface to Rescomp's server
141configuration management system.
142
143Usage:
144  $MYNAME log [ working_copy ]
145
146Look at the log entries for the file or directory specified by working_copy.
147EOF
148;;
149          status )
150cat <<EOF
151$MYNAME provides a command-line interface to Rescomp's server
152configuration management system.
153
154Usage:
155  $MYNAME status [ working_copy ]
156
157Look at the status entries for the file or directory specified by working_copy.
158EOF
159;;
160          state )
161cat <<EOF
162$MYNAME provides a command-line interface to Rescomp's server
163configuration management system.
164
165Usage:
166  $MYNAME state
167
168This command indicates whether the system is "dirty" or "clean."
169
170A dirty system is one that has missed an automated "sync" operation in order
171to preserve changes made by installation operations occuring between the
172repository's export and the system's call to "sync."
173
174Dirty systems may have out-of-date configuration files. Subsquent sync or
175commit operations can bring the sytem up-to-date.
176EOF
177;;
178          cp )
179cat <<EOF
180$MYNAME provides a command-line interface to Rescomp's server
181configuration management system.
182
183Usage:
184  $MYNAME cp src_working_copy dest_working_copy
185
186Copy source to destination. Arguments must be working copies.
187EOF
188;;
189          mv )
190cat <<EOF
191$MYNAME provides a command-line interface to Rescomp's server
192configuration management system.
193
194Usage:
195  $MYNAME mv src_working_copy dest_working_copy
196
197Move source to destination. Arguments must be working copies.
198EOF
199;;
200          co* )
201cat <<EOF
202$MYNAME provides a command-line interface to Rescomp's server
203configuration management system.
204
205Usage:
206  $MYNAME commit
207
208The commit command causes your changes to take effect. This means that
209first, your working copy of all of the modules in the current host's
210recipe will be committed to the repository. This happens after we've run
211a $MYNAME update to prevent out-of-date conflicts. If there are any
212conflicts that require human intervention, the command will fail and exit
213non-zero.
214
215Once $MYNAME is satisfied that all of your changes have been propogated to
216the repository, we will roll-out your working copy to the live filesystem.
217Every module appearing in the host's recipe file will be rolled out IN THE
218ORDER OF APPEARANCE.
219
220EOF
221;;
222          im* )
223cat <<EOF
224$MYNAME provides a command-line interface to Rescomp's server
225configuration management system.
226
227Usage:
228  $MYNAME import module livefile
229
230The import subcommand adds the specified file to your working copy of the
231repository.
232
233EOF
234;;
235          in* )
236cat <<EOF
237$MYNAME provides a command-line interface to Rescomp's server
238configuration management system.
239
240Usage:
241  $MYNAME install workingfile [ workingfile ... ]
242
243The install subcommand allows you to roll out a single file from your working
244copy.
245
246EOF
247;;
248          rev* )
249cat <<EOF
250$MYNAME provides a command-line interface to Rescomp's server
251configuration management system.
252
253Usage:
254  $MYNAME revert workingfile [ workingfile ... ]
255
256The revert subcommand gives you the opportunity to revert to the file before
257you started making changes to it.
258
259EOF
260;;
261          rm )
262cat <<EOF
263$MYNAME provides a command-line interface to Rescomp's server configuration
264management system.
265
266Usage:
267  $MYNAME rm file
268
269The remove subcommand removes a file from version control It will NOT remove
270the file from the live filesystem.
271
272EOF
273;;
274          mk* )
275cat <<EOF
276$MYNAME provides a command-line interface to Rescomp's server configuration
277management system.
278
279Usage:
280  $MYNAME mkdir directory
281
282This command will create a new version-controlled directory in your working
283copy.  Parent directories do not have to exist; they will be created
284automagically. This command only affects your working copy. It does not commit
285the change.
286
287EOF
288;;
289          ls )
290cat<<EOF
291$MYNAME provides a command-line interface to Rescomp's server configuration
292management system.
293
294Usage:
295  $MYNAME ls [ file | directory ]
296
297The ls subcommand lists out the contents, in modified long form, of the
298current working directory. If a file or directory is specified, it will list
299that instead.
300
301EOF
302;;
303          lsattr )
304cat<<EOF
305$MYNAME provides a command-line interface to Rescomp's server configuration
306management system.
307
308Usage:
309  $MYNAME lsattr [ file | directory ]
310
311The lsattr subcommand lists out the confman attributes of files in the
312repository. These attributes can be used to store information such as
313file permissions, ownership, comment characters, syntax checkers, and
314even commands to execute when changing the file.
315
316EOF
317;;
318          chattr )
319cat<<EOF
320$MYNAME provides a command-line interface to Rescomp's server configuration
321management system.
322
323Usage:
324  $MYNAME chattr attribute value [ file | directory ]
325
326The chattr subcommand alters the confman attributes of files in the
327repository. These attributes can be used to store information such as
328file permissions, ownership, comment characters, syntax checkers, and
329even commands to execute when changing the file.
330
331EOF
332;;
333          rmattr )
334cat<<EOF
335$MYNAME provides a command-line interface to Rescomp's server configuration
336management system.
337
338Usage:
339  $MYNAME rmattr attribute [ file | directory ]
340
341The rmattr subcommand removes the confman attributes of files in the
342repository. These attributes can be used to store information such as
343file permissions, ownership, comment characters, syntax checkers, and
344even commands to execute when changing the file.
345
346EOF
347;;
348          cho* )
349cat <<EOF
350$MYNAME provides a command-line interface to Rescomp's server configuration
351management system.
352
353Usage:
354  $MYNAME chown [ -R ] owner [ file | directory ]
355
356The chown command works like it's unix equivalent. It does not support
357user:group notation. The only option it will take is -R for recursive.
358
359EOF
360;;
361          chg* )
362cat <<EOF
363$MYNAME provides a command-line interface to Rescomp's server configuration
364management system.
365
366Usage:
367  $MYNAME chgrp group [ file | directory ]
368
369The chgrp command works like it's unix equivalent. The only option it will take
370is -R for recursive.
371
372EOF
373;;
374          chm* )
375cat <<EOF
376$MYNAME provides a command-line interface to Rescomp's server configuration
377management system.
378
379Usage:
380  $MYNAME chmod mode [ file | directory ]
381
382The chmod command works like it's unix equivalent. Note that it will only
383accept octets as permissions -- it will not interpret symbolic permissions
384correctly. The only option it will take is -R for recursive.
385
386EOF
387;;
388          chc* )
389cat <<EOF
390$MYNAME provides a command-line interface to Rescomp's server configuration
391management system.
392
393Usage:
394  $MYNAME chcom comment-character [ file | directory ]
395
396The chcom subcommand takes a file or directory as an argument and changes the
397comment string associated with it. This will typically only be useful when
398confman has guessed the comment character of your file incorrectly.
399
400EOF
401;;
402          checkl* )
403cat <<EOF
404$MYNAME provides a command-line interface to Rescomp's server
405configuration management system.
406
407Usage:
408  $MYNAME checklook module
409
410The checklook command peeks into the checkpoints for the specified module
411and gives you a listing of current checkpoints with some other cool info.
412This command does not alter the repository.
413
414EOF
415;;
416          checkn* )
417cat <<EOF
418$MYNAME provides a command-line interface to Rescomp's server
419configuration management system.
420
421Usage:
422  $MYNAME checknew module name
423
424The newcheck command creates a named checkpoint for the specified module.
425This change is committed to the repository immediately.
426
427EOF
428;;
429          checkc* )
430cat <<EOF
431$MYNAME provides a command-line interface to Rescomp's server
432configuration management system.
433
434Usage:
435  $MYNAME checkclear module name
436
437The rmcheck command clears a named checkpoint from the specified module.
438This change is committed to the repository immediately.
439
440EOF
441;;
442          ro* )
443cat <<EOF
444$MYNAME provides a command-line interface to Rescomp's server
445configuration management system.
446
447Usage:
448  $MYNAME rollback module [ checkpoint | YYYYMMDD [HHMM] ]
449
450The rollback command first rolls your working copy of module back to the
451named checkpoint. You can optionally roll-back to a specific point in time
452using a date (and optionally time) as specified in the usage statement.
453This change is immediately committed to the repository.
454
455After the rollback is complete, we perform the equivalent of a:
456  $MYNAME commit
457
458EOF
459;;
460          * )
461print_usage 1
462;;
463esac
464exit $2
465}
466
467
468
Note: See TracBrowser for help on using the repository browser.