exec

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Feb 2, 2026 License: BSD-3-Clause Imports: 7 Imported by: 1

Documentation

Overview

Package exec allows invoking other commands, including triggering the manual, opening a document, or opening a Web page in the default Web browser. It also provides a representation of the flag value syntax used by the -exec expression in Unix-like find designed to pass the name of a command and its arguments.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Open

func Open(fileapp ...string) error

Open a file or URL, optionally in the given app. Either one or two arguments is specified, the name/URL of the file to open and the name of the app to use. If the argument looks like a URL, then it triggers the use of the protocol handler associated with the protocol if no app is specified.

Types

type ArgList

type ArgList []string

ArgList provides a value that describes a command and its arguments used as a flag, arg, or expression Value. This uses the syntax that the find -exec expression uses, which is terminated by a semi-colon or plus sign. (e.g. -exec COMMAND ; or -exec COMMAND {} +).

func (*ArgList) Args

func (l *ArgList) Args() []string

Args gets the list of items added, including the command as Args()[0]

func (*ArgList) Command

func (l *ArgList) Command() (string, []string)

Command gets the command and its arguments

func (*ArgList) NewCounter

func (l *ArgList) NewCounter() cli.ArgCounter

func (*ArgList) Set

func (l *ArgList) Set(arg string) error

func (*ArgList) String

func (l *ArgList) String() string

func (*ArgList) UsePlaceholder

func (l *ArgList) UsePlaceholder() bool

UsePlaceholder gets whether the arg list ended with +, which is used to indicate that the {} placeholder is to be expanded

Jump to

Keyboard shortcuts

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