garm/vendor/github.com/inconshreveable/mousetrap
Gabriel Adrian Samfira c61b7fd268
Update go modules
Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
2023-03-12 16:22:37 +02:00
..
LICENSE Update go modules 2023-03-12 16:22:37 +02:00
README.md Vendor packages and add Makefile 2022-06-30 10:20:32 +00:00
trap_others.go Update go modules 2023-03-12 16:22:37 +02:00
trap_windows.go Update go modules 2023-03-12 16:22:37 +02: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)