cmd

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2025 License: AGPL-3.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Exec

func Exec(name string, args ...string) (string, error)

Exec executes a command with arguments and captures its combined stdout and stderr.

Parameters:

  • name: the command to execute
  • args: the arguments to pass to the command

Returns:

  • output: the combined stdout and stderr of the command
  • error: any error that occurred during execution

func ExecLine

func ExecLine(cmd string) (string, error)

ExecLine executes a full system command line string and returns its combined output and any error that occurs.

Parameters:

  • cmd: the command line string to execute

Returns:

  • output: the combined stdout and stderr of the command
  • error: any error that occurred during execution

func ExecLineSeparated

func ExecLineSeparated(cmd string) (string, string, error)

ExecLineSeparated executes a full system command line string and returns its stdout, stderr, and any error that occurs.

Parameters:

  • cmd: the command line string to execute

Returns:

  • stdout: the standard output of the command
  • stderr: the standard error of the command
  • error: any error that occurred during execution

func ExecSeparated

func ExecSeparated(name string, args ...string) (string, string, error)

ExecSeparated executes a command with arguments and captures its stdout and stderr separately.

Parameters:

  • name: the command to execute
  • args: the arguments to pass to the command

Returns:

  • stdout: the standard output of the command
  • stderr: the standard error of the command
  • error: any error that occurred during execution

Types

This section is empty.

Jump to

Keyboard shortcuts

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