where

package module
v1.3.2 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2024 License: GPL-3.0 Imports: 5 Imported by: 3

README

where

Yum

Go Report Card License

What is this?

A which or command -v like tool for Go.

How to install

Open a terminal and run the following:

$ go get --ldflags "-s -w" --trimpath -u github.com/mjwhitta/where
$ go install --ldflags "-s -w" --trimpath \
    github.com/mjwhitta/where/cmd/where@latest

Or compile from source:

$ git clone https://github.com/mjwhitta/where.git
$ cd where
$ git submodule update --init
$ make

Usage

package main

import (
    "fmt"

    "github.com/mjwhitta/where"
)

func main() {
    fmt.Println(where.Is("bash"))
}

Documentation

Index

Constants

View Source
const Version string = "1.3.2"

Version is the package version.

Variables

This section is empty.

Functions

func Is

func Is(cmd string) string

Is will return the full path to the specified cmd if it exists in the defined PATH env var.

Types

This section is empty.

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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