vis
a vi-like editor based on Plan 9's structural regular expressions
git clone https://9o.is/git/vis.git
vis-complete.1
(1597B)
1 .Dd March 21, 2023
2 .Dt VIS-COMPLETE 1
3 .Os Vis VERSION
4 .
5 .Sh NAME
6 .Nm vis-complete
7 .Nd Interactively complete file or word
8 .
9 .Sh SYNOPSIS
10 .Nm vis-complete
11 .Op Fl -file | -word
12 .Op Ar --
13 .Ar pattern
14 .Pp
15 .Nm vis-complete
16 .Fl h | -help
17 .
18 .Sh DESCRIPTION
19 .Nm vis-complete
20 takes a pattern on the command-line and completes file or word and displays
21 them in a menu for the user to select one.
22 Once the user has selected a completion, the completion (excluding the
23 pattern) is printed to standard output.
24 .Pp
25 .Nm vis-complete
26 uses
27 .Xr vis-menu 1
28 as its user-interface,
29 so see that page for more details.
30 .
31 .Bl -tag -width flag
32 .It Fl -file
33 This passes
34 .Ar pattern
35 to
36 .Nm find
37 to obtain a list of matching file names
38 (this is the default).
39 .It Fl -word
40 This reads standard input to obtain a list of lines matching
41 .Ar pattern .
42 .It Fl -
43 An argument following this token will be treated as pattern,
44 even if it would otherwise be a valid command-line option.
45 .Pp
46 If encountered after a previous instance of
47 .Li --
48 it is treated as a pattern.
49 .It Ar pattern
50 The pattern to be completed by file or word.
51 .It Fl h | Fl -help
52 If present,
53 .Nm vis-complete
54 prints a usage summary and exits,
55 ignoring any other flag and arguments.
56 .El
57 .
58 .Sh EXIT STATUS
59 .Ex -std vis-complete
60 .Pp
61 In particular,
62 like
63 .Xr vis-menu 1 ,
64 .Nm vis-complete
65 prints nothing and sets its exit status to 1
66 if the user refused to select a file.
67 .
68 .Sh SEE ALSO
69 .Xr vis 1 ,
70 .Xr vis-menu 1
71 .
72 .Sh BUGS
73 Because
74 .Nm vis-complete
75 uses
76 .Xr find 1
77 to obtain the list of files, weird things might happen if you have
78 control-characters in your filenames.