Coder Social home page Coder Social logo

jonike / open-golang Goto Github PK

View Code? Open in Web Editor NEW

This project forked from skratchdot/open-golang

0.0 3.0 0.0 14 KB

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

License: MIT License

Makefile 3.23% Go 96.77%

open-golang's Introduction

open

Description

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

Documentation

http://godoc.org/github.com/skratchdot/open-golang/open

Import

import "github.com/skratchdot/open-golang/open"

Usage

open google.com in the user's default browser (method 1):

open.Run("https://google.com/")

open google.com in the user's default browser (method 2):

open.Start("https://google.com")

you can listen for errors

err := open.Run("https://google.com/")

you can specify the program to use

open.RunWith("https://google.com/", "firefox")	

Functions

func Run(input string) error

Open a file, directory, or URI using the OS's default application for
that object type. Wait for the open command to complete.

func RunWith(input string, appName string) error

Open a file, directory, or URI using the specified application. Wait for
the open command to complete.

func Start(input string) error

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 StartWith(input string, appName string) error

Open a file, directory, or URI using the specified application. Don't
wait for the open command to complete.

License

Copyright (c) 2013 skratchdot
Licensed under the MIT license.

open-golang's People

Contributors

byron avatar fffw avatar grymoire7 avatar oxtoacart avatar skratchdot avatar sorcix avatar thundergroove avatar

Watchers

 avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.