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

..28-Oct-2021-

LICENSEH A D28-Oct-2021551 1410

README.mdH A D28-Oct-2021848 2415

trap_others.goH A D28-Oct-2021483 164

trap_windows.goH A D28-Oct-20212.3 KiB9974

trap_windows_1.4.goH A D28-Oct-20211.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