summaryrefslogtreecommitdiffstats
path: root/usr.bin/devmenu/devmenu.1
blob: f277baafb3454699729c534665d1c66bce971861 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
.\"
.\" Copyright 1995 Massachusetts Institute of Technology
.\"
.\" Permission to use, copy, modify, and distribute this software and
.\" its documentation for any purpose and without fee is hereby
.\" granted, provided that both the above copyright notice and this
.\" permission notice appear in all copies, that both the above
.\" copyright notice and this permission notice appear in all
.\" supporting documentation, and that the name of M.I.T. not be used
.\" in advertising or publicity pertaining to distribution of the
.\" software without specific, written prior permission.  M.I.T. makes
.\" no representations about the suitability of this software for any
.\" purpose.  It is provided "as is" without express or implied
.\" warranty.
.\" 
.\" THIS SOFTWARE IS PROVIDED BY M.I.T. ``AS IS''.  M.I.T. DISCLAIMS
.\" ALL EXPRESS OR IMPLIED WARRANTIES WITH REGARD TO THIS SOFTWARE,
.\" INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
.\" MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT
.\" SHALL M.I.T. BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
.\" SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
.\" LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF
.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
.\" ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
.\" OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
.\" OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\"	$Id: devmenu.1,v 1.1 1995/04/13 21:10:58 wollman Exp $
.Dd April 14, 1995
.Dt DEVMENU 1
.Os FreeBSD 2.1
.Sh NAME
.Nm devmenu
.Nd present a menu of available devices
.Sh SYNOPSIS
.Nm devmenu
.Op Fl c Ar class
.Op Fl f Ar outfile
.Op Fl h Ar helpfile
.Op Fl s Ar state
.Op Fl t Ar title
.Op Fl nid
.Op Ar name ...
.Sh DESCRIPTION
The
.Nm
program uses the
.Xr dialog 3
library to present a menu of available devices meeting some set of
criteria.  The list of devices is obtained using the
.Xr sysctl 3
device configuration database
.Pq Dq devconf ,
and intersected with the list of
.No Ar name Ns s
if one was specified on the command line.  The following command-line
flags are supported:
.Bl -tag -width mhmhelpfile
.It Fl c Ar class
specifies a class of devices to further restrict the available
choices.  Multiple
.Fl c
options can be specified, in which case the union of the specified
classes is used.  The following classes are currently supported:
.Pp
.Bl -tag -compact -width parallel
.It Li cpu
a processor
.It Li bus
a system bus, or a peripheral bus
.It Li disk
a read-write disk drive
.It Li rodisk
a read-only disk drive (e.g., CD-ROM)
.It Li display
a display device (usually there is only one)
.It Li serial
a serial port or multiport controller
.It Li parallel
a parallel printer port
.It Li netif
a network interface
.It Li misc
everything else
.El
.Pp
.It Fl s Ar state
specifies a required state or set of states to further restrict the
list of devices.  States are specified using the following letters:
.Pp
.Bl -tag -compact -width "! or ~"
.It Li \&! or Li \&~
at the beginning of a string requests the complement of the specified
states.
.It Li \&?
requests devices with state
.Dv DC_UNKNOWN .
.It Li \&u
requests devices with state
.Dv DC_UNCONFIGURED .
.It Li \&i
requests devices with state
.Dv DC_IDLE .
.It Li \&b
requests devices with state
.Dv DC_BUSY .
.El
.Pp
Multiple
.Fl s
options can be specified, in which case the union of all the requested
states is taken.
.It Fl f Ar outfile
specifies the name a file where the name of the selected device is
written.  If no file is specified, the name is written on the standard
output.
.It Fl h Ar helpfile
can be used to specify the name of a file to be displayed when the
user presses the `?' key.
.It Fl t Ar title
specifies the title of the window passed to the
.Xr dialog 3
library when creating the menu.
.El
.Pp
In addition, there are three flags to request special menus with
unique prompt text and possibly pseudo-devices (but this is not yet
implemented).  These are:
.Bl -tag -width xxx
.It Fl n
requests a menu of network interfaces
.It Fl i
requests a menu of possible installation media (i.e., disks, CD-ROMs,
and tapes)
.It Fl d
requests a menu of disks
.El
.Sh SEE ALSO
.Xr sysctl 3 ,
.Xr lsdev 8
.Sh AUTHOR
The
.Nm
program was written by Garrett A. Wollman at the MIT Laboratory for
Computer Science.
.Sh HISTORY
A
.Nm
command first appeared in
.Tn FreeBSD
2.1.
OpenPOWER on IntegriCloud