appcore/open/open.go

18 lines
538 B
Go
Raw Permalink Normal View History

2025-06-16 22:26:47 +05:30
// Copyright 2024 Patial Tech (Ankit Patial).
//
// This file is part of code.patial.tech/go/appcore, which is MIT licensed.
// See http://opensource.org/licenses/MIT
2025-06-16 22:19:00 +05:30
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()
}