debian-forge-composer/vendor/github.com/inconshreveable/mousetrap
Ondřej Budai 0359647a82 go.mod: update to Go 1.18
Fedora 35 support was dropped, so we can update to a newer Go.

Stable RHEL 8 and 9 and Fedora 36 ships Go 1.18, so let's switch to it.

"//go:build" directives are now apparently enforced by go fmt, so that's why
there were added.

Also, all the github actions were adjusted to use Go 1.18.

Signed-off-by: Ondřej Budai <ondrej@budai.cz>
2023-01-09 14:03:18 +01:00
..
LICENSE build(deps): bump github.com/spf13/cobra from 1.5.0 to 1.6.1 2022-10-31 11:34:44 +01:00
README.md OCI: vendor dependencies 2022-01-28 15:16:47 +01:00
trap_others.go OCI: vendor dependencies 2022-01-28 15:16:47 +01:00
trap_windows.go OCI: vendor dependencies 2022-01-28 15:16:47 +01:00
trap_windows_1.4.go OCI: vendor dependencies 2022-01-28 15:16:47 +01:00

mousetrap

mousetrap is a tiny library that answers a single question.

On a Windows machine, was the process invoked by someone double clicking on the executable file while browsing in explorer?

Motivation

Windows developers unfamiliar with command line tools will often "double-click" the executable for a tool. Because most CLI tools print the help and then exit when invoked without arguments, this is often very frustrating for those users.

mousetrap provides a way to detect these invocations so that you can provide more helpful behavior and instructions on how to run the CLI tool. To see what this looks like, both from an organizational and a technical perspective, see https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/

The interface

The library exposes a single interface:

func StartedByExplorer() (bool)