podman
50 строк · 1.2 Кб
1/*
2
3Open a file, directory, or URI using the OS's default
4application for that object type. Optionally, you can
5specify an application to use.
6
7This is a proxy for the following commands:
8
9OSX: "open"
10Windows: "start"
11Linux/Other: "xdg-open"
12
13This is a golang port of the node.js module: https://github.com/pwnall/node-open
14
15*/
16package open17
18/*
19Open a file, directory, or URI using the OS's default
20application for that object type. Wait for the open
21command to complete.
22*/
23func Run(input string) error {24return open(input).Run()25}
26
27/*
28Open a file, directory, or URI using the OS's default
29application for that object type. Don't wait for the
30open command to complete.
31*/
32func Start(input string) error {33return open(input).Start()34}
35
36/*
37Open a file, directory, or URI using the specified application.
38Wait for the open command to complete.
39*/
40func RunWith(input string, appName string) error {41return openWith(input, appName).Run()42}
43
44/*
45Open a file, directory, or URI using the specified application.
46Don't wait for the open command to complete.
47*/
48func StartWith(input string, appName string) error {49return openWith(input, appName).Start()50}
51