diff --git a/gocode.go b/gocode.go
index <HASH>..<HASH> 100644
--- a/gocode.go
+++ b/gocode.go
@@ -23,7 +23,25 @@ func get_socket_filename() string {
 	return filepath.Join(os.TempDir(), fmt.Sprintf("gocode-daemon.%s", user))
 }
 
+func show_usage() {
+	fmt.Fprintf(os.Stderr,
+		"Usage: %s [-s] [-f=<format>] [-in=<path>] [-sock=<type>] [-addr=<addr>]\n"+
+		"       <command> [<args>]\n\n",
+		os.Args[0])
+	fmt.Fprintf(os.Stderr,
+		"Flags:\n")
+	flag.PrintDefaults()
+	fmt.Fprintf(os.Stderr,
+		"\nCommands:\n"+
+		"  autocomplete [<path>] <offset>     main autocompletion command\n"+
+		"  close                              close the gocode daemon\n"+
+		"  status                             gocode daemon status report\n"+
+		"  drop-cache                         drop gocode daemon's cache\n"+
+		"  set [<name> [<value>]]             list or set config options\n")
+}
+
 func main() {
+	flag.Usage = show_usage
 	flag.Parse()
 
 	var retval int
Add command list to the output when running with -h flag.