binfmt

package module
v0.0.0-...-28e6cf4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 27, 2024 License: MIT Imports: 8 Imported by: 1

README

go.binfmt

An extension library for os/exec.

pkg.go.dev GitHub Actions Appveyor Codecov

Installation

$ go get -u github.com/hattya/go.binfmt

Usage

package main

import (
	"fmt"
	"os"

	"github.com/hattya/go.binfmt"
)

func main() {
	cmd := binfmt.Command("rst2html5.py", "README.rst", "README.html")
	cmd.Stdin = os.Stdin
	cmd.Stdout = os.Stdout
	cmd.Stderr = os.Stderr
	if err := cmd.Run(); err != nil {
		fmt.Fprintln(os.Stderr, err)
		os.Exit(1)
	}
}

License

go.binfmt is distributed under the terms of the MIT License.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Command

func Command(name string, arg ...string) *exec.Cmd

func CommandContext

func CommandContext(ctx context.Context, name string, arg ...string) *exec.Cmd

func Register

func Register(name string, command CommandFunc)

Types

type CommandFunc

type CommandFunc interface{}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL