• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

LICENSEH A D17-Oct-2014551 1410

README.mdH A D17-Oct-2014848 2415

trap_others.goH A D17-Oct-2014483 164

trap_windows.goH A D17-Oct-20142.3 KiB9974

trap_windows_1.4.goH A D17-Oct-20141.2 KiB4734

README.md

1# mousetrap
2
3mousetrap is a tiny library that answers a single question.
4
5On a Windows machine, was the process invoked by someone double clicking on
6the executable file while browsing in explorer?
7
8### Motivation
9
10Windows developers unfamiliar with command line tools will often "double-click"
11the executable for a tool. Because most CLI tools print the help and then exit
12when invoked without arguments, this is often very frustrating for those users.
13
14mousetrap provides a way to detect these invocations so that you can provide
15more helpful behavior and instructions on how to run the CLI tool. To see what
16this looks like, both from an organizational and a technical perspective, see
17https://inconshreveable.com/09-09-2014/sweat-the-small-stuff/
18
19### The interface
20
21The library exposes a single interface:
22
23    func StartedByExplorer() (bool)
24