source: tags/confman-1.5.6a5/confmandoc.sh @ 212

Revision 212, 12.6 KB checked in by mattea, 4 years ago (diff)

Tagging fixed symlinking

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