basic common app packages
This commit is contained in:
16
open/open.go
Normal file
16
open/open.go
Normal file
@@ -0,0 +1,16 @@
|
||||
// Copyright 2024 Patial Tech. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style
|
||||
// license that can be found in the LICENSE file.
|
||||
|
||||
package open
|
||||
|
||||
// WithDefaultApp open a file, directory, or URI using the OS's default application for that object type.
|
||||
func WithDefaultApp(input string) error {
|
||||
cmd := open(input)
|
||||
return cmd.Run()
|
||||
}
|
||||
|
||||
// WithApp will open a file directory, or URI using the specified application.
|
||||
func App(input string, appName string) error {
|
||||
return openWith(input, appName).Run()
|
||||
}
|
Reference in New Issue
Block a user