cmdr
Hex Artifact Content
Not logged in
Bounty program for improvements to Tcl and certain Tcl packages.

Artifact 8883918a90b2e2b3ceb90ff378b24a60377c9133:


0000: 5b 63 6f 6d 6d 65 6e 74 20 7b 2d 2a 2d 20 74 63  [comment {-*- tc
0010: 6c 20 2d 2a 2d 20 64 6f 63 74 6f 6f 6c 73 20 6d  l -*- doctools m
0020: 61 6e 70 61 67 65 7d 5d 0a 5b 69 6e 63 6c 75 64  anpage}].[includ
0030: 65 20 70 61 72 74 73 2f 64 65 66 69 6e 69 74 69  e parts/definiti
0040: 6f 6e 73 2e 69 6e 63 5d 0a 5b 76 73 65 74 20 56  ons.inc].[vset V
0050: 45 52 53 49 4f 4e 20 31 2e 33 2e 32 5d 0a 5b 6d  ERSION 1.3.2].[m
0060: 61 6e 70 61 67 65 5f 62 65 67 69 6e 20 5b 76 73  anpage_begin [vs
0070: 65 74 20 4c 41 42 45 4c 5f 48 45 4c 50 5d 20 5b  et LABEL_HELP] [
0080: 76 73 65 74 20 4d 41 4e 5f 53 45 43 54 49 4f 4e  vset MAN_SECTION
0090: 5d 20 5b 76 73 65 74 20 56 45 52 53 49 4f 4e 5d  ] [vset VERSION]
00a0: 5d 0a 5b 69 6e 63 6c 75 64 65 20 70 61 72 74 73  ].[include parts
00b0: 2f 6d 6f 64 75 6c 65 2e 69 6e 63 5d 0a 5b 72 65  /module.inc].[re
00c0: 71 75 69 72 65 20 63 6d 64 72 3a 3a 68 65 6c 70  quire cmdr::help
00d0: 5d 0a 5b 74 69 74 6c 65 64 65 73 63 20 5b 76 73  ].[titledesc [vs
00e0: 65 74 20 54 49 54 4c 45 5f 48 45 4c 50 5d 5d 0a  et TITLE_HELP]].
00f0: 5b 64 65 73 63 72 69 70 74 69 6f 6e 5d 0a 5b 69  [description].[i
0100: 6e 63 6c 75 64 65 20 70 61 72 74 73 2f 77 65 6c  nclude parts/wel
0110: 63 6f 6d 65 2e 69 6e 63 5d 0a 0a 54 68 69 73 20  come.inc]..This 
0120: 69 6e 74 65 72 6e 61 6c 20 70 61 63 6b 61 67 65  internal package
0130: 20 69 6d 70 6c 65 6d 65 6e 74 73 20 74 68 65 20   implements the 
0140: 66 6f 75 72 20 73 74 61 6e 64 61 72 64 20 68 65  four standard he
0150: 6c 70 20 66 6f 72 6d 61 74 73 0a 0a 5b 6c 69 73  lp formats..[lis
0160: 74 5f 62 65 67 69 6e 20 65 6e 75 6d 65 72 61 74  t_begin enumerat
0170: 65 64 5d 0a 5b 65 6e 75 6d 5d 20 5b 63 6f 6e 73  ed].[enum] [cons
0180: 74 20 66 75 6c 6c 5d 2c 0a 5b 65 6e 75 6d 5d 20  t full],.[enum] 
0190: 5b 63 6f 6e 73 74 20 73 68 6f 72 74 5d 2c 0a 5b  [const short],.[
01a0: 65 6e 75 6d 5d 20 5b 63 6f 6e 73 74 20 6c 69 73  enum] [const lis
01b0: 74 5d 2c 20 61 6e 64 0a 5b 65 6e 75 6d 5d 20 5b  t], and.[enum] [
01c0: 63 6f 6e 73 74 20 62 79 2d 63 61 74 65 67 6f 72  const by-categor
01d0: 79 5d 2e 0a 5b 6c 69 73 74 5f 65 6e 64 5d 0a 0a  y]..[list_end]..
01e0: 5b 70 61 72 61 5d 20 49 74 20 70 72 6f 76 69 64  [para] It provid
01f0: 65 73 20 61 20 73 69 6e 67 6c 65 20 75 74 69 6c  es a single util
0200: 69 74 79 20 63 6f 6d 6d 61 6e 64 20 75 73 65 64  ity command used
0210: 20 62 79 20 74 68 65 20 6f 74 68 65 72 20 70 61   by the other pa
0220: 72 74 73 20 6f 66 0a 74 68 65 20 66 72 61 6d 65  rts of.the frame
0230: 77 6f 72 6b 20 74 6f 20 61 64 64 20 61 20 5b 73  work to add a [s
0240: 79 73 63 6d 64 20 68 65 6c 70 5d 20 63 6f 6d 6d  yscmd help] comm
0250: 61 6e 64 20 74 6f 20 61 6e 79 0a 5b 70 61 63 6b  and to any.[pack
0260: 61 67 65 20 63 6d 64 72 3a 3a 61 63 74 6f 72 5d  age cmdr::actor]
0270: 20 72 65 71 75 69 72 69 6e 67 20 73 75 63 68 2e   requiring such.
0280: 0a 0a 5b 73 65 63 74 69 6f 6e 20 41 50 49 5d 0a  ..[section API].
0290: 5b 6c 69 73 74 5f 62 65 67 69 6e 20 64 65 66 69  [list_begin defi
02a0: 6e 69 74 69 6f 6e 73 5d 0a 5b 63 6f 6d 6d 65 6e  nitions].[commen
02b0: 74 20 7b 2d 20 2d 20 2d 2d 20 2d 2d 2d 20 2d 2d  t {- - -- --- --
02c0: 2d 2d 2d 20 2d 2d 2d 2d 2d 2d 2d 2d 20 2d 2d 2d  --- -------- ---
02d0: 2d 2d 2d 2d 2d 2d 2d 2d 2d 2d 7d 5d 0a 5b 63 61  ----------}].[ca
02e0: 6c 6c 20 5b 63 6d 64 20 3a 3a 63 6d 64 72 3a 3a  ll [cmd ::cmdr::
02f0: 68 65 6c 70 5d 20 5b 6d 65 74 68 6f 64 20 61 75  help] [method au
0300: 74 6f 5d 20 5b 61 72 67 20 61 63 74 6f 72 5d 5d  to] [arg actor]]
0310: 0a 0a 57 68 65 6e 20 69 6e 76 6f 6b 65 64 20 74  ..When invoked t
0320: 68 69 73 20 63 6f 6d 6d 61 6e 64 20 65 78 74 65  his command exte
0330: 6e 64 73 20 74 68 65 20 5b 61 72 67 20 61 63 74  nds the [arg act
0340: 6f 72 5d 20 77 69 74 68 20 61 20 5b 63 6f 6e 73  or] with a [cons
0350: 74 20 68 65 6c 70 5d 0a 63 6f 6d 6d 61 6e 64 2e  t help].command.
0360: 20 54 68 65 20 72 65 73 75 6c 74 20 6f 66 20 74   The result of t
0370: 68 65 20 63 6f 6d 6d 61 6e 64 20 69 73 20 74 68  he command is th
0380: 65 20 65 6d 70 74 79 20 73 74 72 69 6e 67 2e 0a  e empty string..
0390: 0a 5b 70 61 72 61 5d 20 54 68 65 20 69 6e 73 65  .[para] The inse
03a0: 72 74 65 64 20 63 6f 6d 6d 61 6e 64 20 77 69 6c  rted command wil
03b0: 6c 20 61 63 63 65 70 74 20 61 6c 6c 20 6b 6e 6f  l accept all kno
03c0: 77 6e 20 66 6f 72 6d 61 74 20 6e 61 6d 65 73 20  wn format names 
03d0: 61 73 0a 6f 70 74 69 6f 6e 73 2c 20 65 6e 61 62  as.options, enab
03e0: 6c 69 6e 67 20 74 68 65 20 75 73 65 72 20 74 6f  ling the user to
03f0: 20 63 68 6f 6f 73 65 20 74 68 65 20 66 6f 72 6d   choose the form
0400: 20 6f 66 20 74 68 65 20 68 65 6c 70 2e 20 42 79   of the help. By
0410: 20 64 65 66 61 75 6c 74 0a 74 68 65 20 66 6f 72   default.the for
0420: 6d 61 74 20 5b 63 6f 6e 73 74 20 62 79 2d 63 61  mat [const by-ca
0430: 74 65 67 6f 72 79 5d 20 77 69 6c 6c 20 62 65 20  tegory] will be 
0440: 75 73 65 64 2c 20 65 78 63 65 70 74 20 69 66 20  used, except if 
0450: 61 20 63 6f 6d 6d 61 6e 64 20 6e 61 6d 65 0a 77  a command name.w
0460: 61 73 20 67 69 76 65 6e 20 74 6f 20 5b 73 79 73  as given to [sys
0470: 63 6d 64 20 68 65 6c 70 5d 2c 20 74 68 65 6e 20  cmd help], then 
0480: 74 68 65 20 64 65 66 61 75 6c 74 20 77 69 6c 6c  the default will
0490: 20 62 65 20 5b 63 6f 6e 73 74 20 66 75 6c 6c 5d   be [const full]
04a0: 2e 0a 0a 5b 70 61 72 61 5d 20 41 6e 20 61 64 64  ...[para] An add
04b0: 69 74 69 6f 6e 61 6c 20 6f 70 74 69 6f 6e 20 61  itional option a
04c0: 63 63 65 70 74 65 64 20 62 79 20 5b 73 79 73 63  ccepted by [sysc
04d0: 6d 64 20 68 65 6c 70 5d 20 69 73 0a 5b 63 6f 6e  md help] is.[con
04e0: 73 74 20 2d 2d 77 69 64 74 68 5d 2c 20 67 69 76  st --width], giv
04f0: 69 6e 67 20 74 68 65 20 75 73 65 72 20 63 6f 6e  ing the user con
0500: 74 72 6f 6c 20 6f 76 65 72 20 74 68 65 20 6c 65  trol over the le
0510: 6e 67 74 68 20 6f 66 20 6c 69 6e 65 73 0a 69 6e  ngth of lines.in
0520: 20 74 68 65 20 68 65 6c 70 2e 20 42 79 20 64 65   the help. By de
0530: 66 61 75 6c 74 20 68 65 6c 70 20 77 69 6c 6c 20  fault help will 
0540: 62 65 20 66 6f 72 6d 61 74 74 65 64 20 74 6f 20  be formatted to 
0550: 74 68 65 20 77 69 64 74 68 20 6f 66 20 74 68 65  the width of the
0560: 0a 74 65 72 6d 69 6e 61 6c 2e 0a 0a 5b 6c 69 73  .terminal...[lis
0570: 74 5f 62 65 67 69 6e 20 61 72 67 75 6d 65 6e 74  t_begin argument
0580: 73 5d 0a 5b 61 72 67 5f 64 65 66 20 5b 70 61 63  s].[arg_def [pac
0590: 6b 61 67 65 20 63 6d 64 72 3a 3a 61 63 74 6f 72  kage cmdr::actor
05a0: 5d 20 61 63 74 6f 72 5d 0a 54 68 65 20 5b 70 61  ] actor].The [pa
05b0: 63 6b 61 67 65 20 63 6d 64 72 3a 3a 61 63 74 6f  ckage cmdr::acto
05c0: 72 5d 20 69 6e 73 74 61 6e 63 65 20 74 6f 20 62  r] instance to b
05d0: 65 20 65 78 74 65 6e 64 65 64 20 77 69 74 68 20  e extended with 
05e0: 5b 73 79 73 63 6d 64 20 68 65 6c 70 5d 2e 0a 5b  [syscmd help]..[
05f0: 6c 69 73 74 5f 65 6e 64 5d 0a 5b 6c 69 73 74 5f  list_end].[list_
0600: 65 6e 64 5d 0a 0a 5b 73 65 63 74 69 6f 6e 20 7b  end]..[section {
0610: 46 6f 72 6d 61 74 20 4e 6f 74 65 73 7d 5d 0a 0a  Format Notes}]..
0620: 54 68 65 20 66 6f 72 6d 61 74 20 5b 63 6f 6e 73  The format [cons
0630: 74 20 62 79 2d 63 61 74 65 67 6f 72 79 5d 20 6c  t by-category] l
0640: 6f 6f 6b 73 20 66 6f 72 20 61 6e 64 20 75 73 65  ooks for and use
0650: 73 20 74 68 65 20 62 6c 6f 63 6b 0a 5b 63 6f 6e  s the block.[con
0660: 73 74 20 2a 63 61 74 65 67 6f 72 79 2d 6f 72 64  st *category-ord
0670: 65 72 2a 5d 20 66 6f 72 20 77 68 65 6e 20 74 68  er*] for when th
0680: 65 20 75 73 65 72 20 77 69 73 68 65 73 20 74 6f  e user wishes to
0690: 20 6f 76 65 72 72 69 64 65 20 74 68 65 0a 6e 61   override the.na
06a0: 74 75 72 61 6c 20 28 61 6c 70 68 61 62 65 74 69  tural (alphabeti
06b0: 63 61 6c 29 20 6f 72 64 65 72 20 6f 66 20 64 69  cal) order of di
06c0: 73 70 6c 61 79 20 66 6f 72 20 74 68 65 20 74 6f  splay for the to
06d0: 70 6c 65 76 65 6c 20 73 65 63 74 69 6f 6e 73 2e  plevel sections.
06e0: 0a 0a 5b 70 61 72 61 5d 20 54 68 69 73 20 62 6c  ..[para] This bl
06f0: 6f 63 6b 20 68 61 73 20 74 6f 20 62 65 20 64 65  ock has to be de
0700: 66 69 6e 65 64 20 62 79 20 74 68 65 20 75 73 65  fined by the use
0710: 72 2c 20 69 6e 20 74 68 65 20 72 6f 6f 74 20 6f  r, in the root o
0720: 66 0a 74 68 65 20 63 6f 6d 6d 61 6e 64 20 68 69  f.the command hi
0730: 65 72 61 72 63 68 79 2e 0a 0a 49 74 73 20 76 61  erarchy...Its va
0740: 6c 75 65 20 68 61 73 20 74 6f 20 62 65 20 61 20  lue has to be a 
0750: 64 69 63 74 69 6f 6e 61 72 79 20 6d 61 70 70 69  dictionary mappi
0760: 6e 67 20 66 72 6f 6d 20 74 68 65 20 6e 61 6d 65  ng from the name
0770: 73 20 6f 66 20 74 6f 70 6c 65 76 65 6c 0a 73 65  s of toplevel.se
0780: 63 74 69 6f 6e 73 2f 63 61 74 65 67 6f 72 69 65  ctions/categorie
0790: 73 20 74 6f 20 61 6e 20 69 6e 74 65 67 65 72 20  s to an integer 
07a0: 6e 75 6d 62 65 72 2e 20 54 68 69 73 20 69 73 20  number. This is 
07b0: 75 73 65 64 20 74 6f 20 63 68 61 6e 67 65 0a 74  used to change.t
07c0: 68 65 20 6f 72 64 65 72 20 6f 66 20 64 69 73 70  he order of disp
07d0: 6c 61 79 69 6e 67 20 74 68 65 73 65 20 73 65 63  laying these sec
07e0: 74 69 6f 6e 73 20 69 6e 20 74 68 65 20 67 65 6e  tions in the gen
07f0: 65 72 61 74 65 64 20 74 65 78 74 2e 0a 0a 5b 70  erated text...[p
0800: 61 72 61 5d 20 53 65 63 74 69 6f 6e 73 20 77 69  ara] Sections wi
0810: 74 68 20 68 69 67 68 65 72 2f 6c 61 72 67 65 72  th higher/larger
0820: 20 6e 75 6d 62 65 72 73 20 61 72 65 20 73 68 6f   numbers are sho
0830: 77 6e 20 66 69 72 73 74 2c 20 61 6e 64 0a 6c 6f  wn first, and.lo
0840: 77 65 72 2f 73 6d 61 6c 6c 65 72 20 6e 75 6d 62  wer/smaller numb
0850: 65 72 73 20 6d 6f 76 65 20 74 6f 77 61 72 64 73  ers move towards
0860: 20 74 68 65 20 65 6e 64 2e 20 4e 65 67 61 74 69   the end. Negati
0870: 76 65 20 6e 75 6d 62 65 72 73 20 61 72 65 0a 70  ve numbers are.p
0880: 6f 73 73 69 62 6c 65 2e 0a 0a 5b 70 61 72 61 5d  ossible...[para]
0890: 20 53 65 63 74 69 6f 6e 73 20 6e 6f 74 20 6d 65   Sections not me
08a0: 6e 74 69 6f 6e 65 64 20 69 6e 20 74 68 65 20 64  ntioned in the d
08b0: 69 63 74 69 6f 6e 61 72 79 20 61 72 65 20 61 73  ictionary are as
08c0: 73 69 67 6e 65 64 20 74 68 65 69 72 0a 6e 61 74  signed their.nat
08d0: 75 72 61 6c 20 6e 75 6d 62 65 72 2e 20 54 68 69  ural number. Thi
08e0: 73 20 69 73 20 63 61 6c 63 75 6c 61 74 65 64 20  s is calculated 
08f0: 62 79 20 73 6f 72 74 69 6e 67 20 61 6c 6c 20 73  by sorting all s
0900: 65 63 74 69 6f 6e 73 0a 61 6c 70 68 61 62 65 74  ections.alphabet
0910: 69 63 61 6c 6c 79 20 28 5b 6f 70 74 69 6f 6e 20  ically ([option 
0920: 2d 64 69 63 74 5d 29 20 61 73 63 65 6e 64 69 6e  -dict]) ascendin
0930: 67 20 61 6e 64 20 61 73 73 69 67 6e 69 6e 67 20  g and assigning 
0940: 5b 63 6f 6e 73 74 20 30 5d 0a 74 6f 20 74 68 65  [const 0].to the
0950: 20 66 69 72 73 74 20 73 65 63 74 69 6f 6e 2c 20   first section, 
0960: 5b 63 6f 6e 73 74 20 2d 31 30 5d 20 74 6f 20 74  [const -10] to t
0970: 68 65 20 6e 65 78 74 2c 20 61 6e 64 20 73 6f 20  he next, and so 
0980: 6f 6e 2e 0a 0a 5b 70 61 72 61 5d 20 54 68 65 20  on...[para] The 
0990: 67 65 6e 65 72 61 74 65 64 20 73 65 63 74 69 6f  generated sectio
09a0: 6e 2f 63 61 74 65 67 6f 72 79 20 5b 63 6f 6e 73  n/category [cons
09b0: 74 20 4d 69 73 63 65 6c 6c 61 6e 65 6f 75 73 5d  t Miscellaneous]
09c0: 20 69 73 0a 67 69 76 65 6e 20 74 68 65 20 6e 75   is.given the nu
09d0: 6d 62 65 72 20 5b 63 6f 6e 73 74 20 2d 31 30 30  mber [const -100
09e0: 30 30 5d 20 74 6f 20 66 6f 72 63 65 20 69 74 20  00] to force it 
09f0: 74 6f 20 74 68 65 20 65 6e 64 20 28 62 6f 74 74  to the end (bott
0a00: 6f 6d 29 0a 6f 66 20 74 68 65 20 68 65 6c 70 20  om).of the help 
0a10: 74 65 78 74 2c 20 69 66 20 69 74 20 77 61 73 20  text, if it was 
0a20: 67 65 6e 65 72 61 74 65 64 2e 0a 0a 5b 69 6e 63  generated...[inc
0a30: 6c 75 64 65 20 70 61 72 74 73 2f 66 65 65 64 62  lude parts/feedb
0a40: 61 63 6b 2e 69 6e 63 5d 0a 5b 6d 61 6e 70 61 67  ack.inc].[manpag
0a50: 65 5f 65 6e 64 5d 0a                             e_end].