1VIS-OPEN(1) BSD General Commands Manual VIS-OPEN(1)
2
4 vis-open — Interactively select a file to open
5
7 vis-open [-p prompt] [-f] [--] [files]
8
9 vis-open -h | --help
10
12 vis-open takes a list of filenames and directories on the command-line
13 and displays them in a menu for the user to select one. If the user
14 selects a directory (including ..), the directory contents are displayed
15 as a fresh menu. Once the user has selected a filename, its absolute
16 path is printed to standard output.
17
18 vis-open uses vis-menu(1) as its user-interface, so see that page for
19 more details.
20
21 -p prompt
22 Display prompt before the list of items. This is passed straight
23 through to vis-menu(1).
24
25 -f Normally, if vis-open is provided with a single filename or direc‐
26 tory argument, it will automatically select it (printing the file‐
27 name to standard output, or presenting a new menu with the contents
28 of the directory). If -f is provided, vis-open will always present
29 the arguments it's given, even if there's only one.
30
31 -- If this token is encountered before the first non-option argument,
32 all following arguments will be treated as menu-items, even if they
33 would otherwise be valid command-line options.
34
35 If encountered after the first non-option argument, or after a pre‐
36 vious instance of -- it is treated as a menu-item.
37
38 files
39 File and directory names to be presented to the user. If a name
40 does not exist on the filesystem and the user selects it, it is
41 treated as a file.
42
43 -h | --help
44 If present, vis-open prints a usage summary and exits, ignoring any
45 other flag and arguments.
46
48 The vis-open utility exits 0 on success, and >0 if an error occurs.
49
50 In particular, like vis-menu(1), vis-open prints nothing and sets its
51 exit status to 1 if the user refused to select a file.
52
54 CHOICE=$(vis-open -p "Select a file to stat")
55 if [ $? -gt 0 ]; then
56 echo "No selection was made, or an error occurred"
57 else
58 stat "$CHOICE"
59 fi
60
62 vis(1), vis-menu(1)
63
65 Because vis-open uses ls(1) to obtain the contents of a directory, weird
66 things might happen if you have control-characters in your filenames.
67
68Vis v0.7 November 29, 2016 Vis v0.7