README.md
1# open
2
3## Description ##
4
5 Open a file, directory, or URI using the OS's default application for
6 that object type. Optionally, you can specify an application to use.
7
8 This is a proxy for the following commands:
9
10 OSX: "open"
11 Windows: "start"
12 Linux/Other: "xdg-open"
13
14 This is a golang port of the node.js module:
15 https://github.com/pwnall/node-open
16
17
18## Documentation ##
19
20[http://godoc.org/github.com/skratchdot/open-golang/open](http://godoc.org/github.com/skratchdot/open-golang/open)
21
22## Import ##
23
24 import "github.com/skratchdot/open-golang/open"
25
26## Usage ##
27
28### open google.com in the user's default browser (method 1):
29
30 open.Run("https://google.com/")
31
32### open google.com in the user's default browser (method 2):
33
34 open.Start("https://google.com")
35
36### you can listen for errors
37
38 err := open.Run("https://google.com/")
39
40### you can specify the program to use
41
42 open.RunWith("https://google.com/", "firefox")
43
44
45## Functions ##
46
47### func Run(input string) error
48
49 Open a file, directory, or URI using the OS's default application for
50 that object type. Wait for the open command to complete.
51
52### func RunWith(input string, appName string) error
53
54 Open a file, directory, or URI using the specified application. Wait for
55 the open command to complete.
56
57### func Start(input string) error
58
59 Open a file, directory, or URI using the OS's default application for
60 that object type. Don't wait for the open command to complete.
61
62### func StartWith(input string, appName string) error
63
64 Open a file, directory, or URI using the specified application. Don't
65 wait for the open command to complete.
66
67
68## License ##
69
70Copyright (c) 2013 skratchdot
71Licensed under the MIT license.
72