1ckitem(1)                        User Commands                       ckitem(1)
2
3
4

NAME

6       ckitem,  erritem, helpitem - build a menu; prompt for and return a menu
7       item
8

SYNOPSIS

10       ckitem [-Q] [-W width] [-uno] [-f filename] [-l label]
11            [ [-i invis] [,]...] [-m max] [-d default] [-h help]
12            [-e  error] [-p prompt] [-k pid [-s signal]]
13            [choice [...]]
14
15
16       /usr/sadm/bin/erritem [-W width] [-e error] [choice [..]]
17
18
19       /usr/sadm/bin/helpitem [-W width] [-h help] [choice [..]]
20
21

DESCRIPTION

23       The ckitem utility builds a menu and prompts the  user  to  choose  one
24       item  from a menu of items. It then  verifies the response. Options for
25       this command  define,  among  other  things,  a  prompt  message  whose
26       response  will  be a menu item, text for help and error messages, and a
27       default value (which will be returned if the user responds with a  car‐
28       riage return).
29
30
31       By  default,  the menu is formatted so that each item is prepended by a
32       number and is printed in columns across the terminal. Column length  is
33       determined by the longest choice. Items are alphabetized.
34
35
36       All  messages  are limited in length to 70 characters and are formatted
37       automatically. Any white space used in the definition  (including  new‐
38       line) is stripped. The -W option cancels the automatic formatting. When
39       a tilde is placed at the beginning or end of a message definition,  the
40       default  text will be inserted at that point, allowing both custom text
41       and the default text to be displayed.
42
43
44       If the prompt, help or error message is not defined, the  default  mes‐
45       sage (as defined under NOTES) will be displayed.
46
47
48       Two  visual  tool  modules  are  linked to the ckitem command. They are
49       erritem (which formats and displays  an  error  message)  and  helpitem
50       (which  formats  and  displays a help message). These modules should be
51       used in conjunction with FML objects. In this instance, the FML  object
52       defines  the  prompt. When choice is defined in these modules, the mes‐
53       sages will describe the available menu choice (or choices).
54

OPTIONS

56       The following options are supported:
57
58       -d default     Define the default value as default. The default is  not
59                      validated and so does not have to meet any criteria.
60
61
62       -e error       Define the error message as  error.
63
64
65       -f filename    Define  a  file, filename, which contains a list of menu
66                      items to be displayed. (The  format  of  this  file  is:
67                      token<tab>description. Lines beginning with a pound sign
68                      (#) are designated as comments and ignored.)
69
70
71       -h help        Define the help messages as  help.
72
73
74       -i invis       Define invisible menu choices (those which will  not  be
75                      printed  in  the menu). (For example, ``all'' used as an
76                      invisible choice would mean it is  a  legal  option  but
77                      does  not  appear  in  the menu. Any number of invisible
78                      choices may be defined.)  Invisible  choices  should  be
79                      made  known  to a user either in the prompt or in a help
80                      message.
81
82
83       -k pid         Specify that the process ID pid is to be sent  a  signal
84                      if the user chooses to abort.
85
86
87       -l label       Define a label, label, to print above the menu.
88
89
90       -m max         Define  the maximum number of menu choices that the user
91                      can choose. The default is 1.
92
93
94       -n             Specify that menu  items  should  not  be  displayed  in
95                      alphabetical order.
96
97
98       -o             Specify that only one menu token will be returned.
99
100
101       -p prompt      Define the prompt message as prompt.
102
103
104       -Q             Specify  that  quit  will  not  be  allowed  as  a valid
105                      response.
106
107
108       -s signal      Specify that process ID pid defined with the  -k  option
109                      is  to be sent signal  signal when quit is chosen. If no
110                      signal is specified, SIGTERM is used.
111
112
113       -u             Specify that menu items should be displayed as an unnum‐
114                      bered list.
115
116
117       -W width       Specify  that  prompt,  help  and error messages will be
118                      formatted to a line length of width.
119
120

OPERANDS

122       The following operand is supported:
123
124       choice    Define menu items. Items should be separated by  white  space
125                 or newline.
126
127

EXIT STATUS

129       The following exit values are returned:
130
131       0    Successful execution.
132
133
134       1    EOF on input, or negative width on -W option, or inability to open
135            file on -f option, or usage error.
136
137
138       3    User termination (quit).
139
140
141       4    No choices from which to choose.
142
143

ATTRIBUTES

145       See attributes(5) for descriptions of the following attributes:
146
147
148
149
150       ┌─────────────────────────────┬─────────────────────────────┐
151       │      ATTRIBUTE TYPE         │      ATTRIBUTE VALUE        │
152       ├─────────────────────────────┼─────────────────────────────┤
153       │Availability                 │SUNWcsu                      │
154       └─────────────────────────────┴─────────────────────────────┘
155

SEE ALSO

157       attributes(5)
158

NOTES

160       The user may input the number of the menu item if choices are  numbered
161       or  as  much  of the string required for a unique identification of the
162       item. Long menus are paged with 10 items per page.
163
164
165       When menu entries are defined both in a file (by using the  -f  option)
166       and also on the command line, they are usually combined alphabetically.
167       However, if the -n option is used to suppress   alphabetical  ordering,
168       then  the  entries defined in the file are shown first, followed by the
169       options defined on the command line.
170
171
172       The default prompt for ckitem is:
173
174         Enter selection [?,??,q]:
175
176
177
178
179       One question mark will give a  help  message  and  then  redisplay  the
180       prompt.  Two question marks will give a help message and then redisplay
181       the menu label, the menu and the prompt.
182
183
184       The default error message if you typed a number is:
185
186         ERROR: Bad numeric choice specification
187
188
189
190
191       The default error message if you typed a string is:
192
193         ERROR: Entry does not match available menu selection. Enter the number
194         of the menu item you wish to select, the token which is associated
195         with the menu item, or a partial string which uniquely identifies the
196         token for the menu item. Enter ?? to reprint the menu.
197
198
199
200
201       The default help message is:
202
203         Enter the number of the menu item you wish to select, the token
204         which is associated with the menu item, or a partial string which
205         uniquely identifies the token for the menu item. Enter ? to
206         reprint the menu.
207
208
209
210
211       When the quit option is chosen (and allowed), q is returned along  with
212       the return code 3.
213
214
215
216SunOS 5.11                        14 Sep 1992                        ckitem(1)
Impressum