File: open.go

package info (click to toggle)
golang-github-skratchdot-open-golang 0.0~git20160302.0.75fb7ed-3
  • links: PTS, VCS
  • area: main
  • in suites: experimental, forky, sid
  • size: 128 kB
  • sloc: sh: 380; makefile: 7
file content (50 lines) | stat: -rw-r--r-- 1,185 bytes parent folder | download | duplicates (3)
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
/*

	Open a file, directory, or URI using the OS's default
	application for that object type.  Optionally, you can
	specify an application to use.

	This is a proxy for the following commands:

	         OSX: "open"
	     Windows: "start"
	 Linux/Other: "xdg-open"

	This is a golang port of the node.js module: https://github.com/pwnall/node-open

*/
package open

/*
	Open a file, directory, or URI using the OS's default
	application for that object type. Wait for the open
	command to complete.
*/
func Run(input string) error {
	return open(input).Run()
}

/*
	Open a file, directory, or URI using the OS's default
	application for that object type. Don't wait for the
	open command to complete.
*/
func Start(input string) error {
	return open(input).Start()
}

/*
	Open a file, directory, or URI using the specified application.
	Wait for the open command to complete.
*/
func RunWith(input string, appName string) error {
	return openWith(input, appName).Run()
}

/*
	Open a file, directory, or URI using the specified application.
	Don't wait for the open command to complete.
*/
func StartWith(input string, appName string) error {
	return openWith(input, appName).Start()
}