镜像自地址
				https://github.com/quitesimpleorg/hs9001.git
				已同步 2025-10-31 04:19:30 +01:00 
			
		
		
		
	Use exit status 23 as a do not log code
这个提交包含在:
		| @@ -15,7 +15,7 @@ Add this to .bashrc | |||||||
|  |  | ||||||
| ``` | ``` | ||||||
| if [ -n "$PS1" ] ; then | if [ -n "$PS1" ] ; then | ||||||
|     PROMPT_COMMAND='hs9001 add "$(history 1)"' |     PROMPT_COMMAND='hs9001 -ret $? add "$(history 1)"' | ||||||
| fi | fi | ||||||
| ``` | ``` | ||||||
| By default, every system user gets his own database. You can override this by overriding the environment variable | By default, every system user gets his own database. You can override this by overriding the environment variable | ||||||
|   | |||||||
							
								
								
									
										6
									
								
								main.go
									
									
									
									
									
								
							
							
						
						
									
										6
									
								
								main.go
									
									
									
									
									
								
							| @@ -119,6 +119,8 @@ func exists(path string) (bool, error) { | |||||||
| } | } | ||||||
|  |  | ||||||
| func main() { | func main() { | ||||||
|  | 	var ret int | ||||||
|  | 	flag.IntVar(&ret, "ret", 0, "Return value of the command to add") | ||||||
| 	flag.Parse() | 	flag.Parse() | ||||||
| 	args := flag.Args() | 	args := flag.Args() | ||||||
| 	argslen := len(args) | 	argslen := len(args) | ||||||
| @@ -133,6 +135,9 @@ func main() { | |||||||
| 	conn := createConnection() | 	conn := createConnection() | ||||||
|  |  | ||||||
| 	if cmd == "add" { | 	if cmd == "add" { | ||||||
|  | 		if ret == 23 { // 23 is our secret do not log status code | ||||||
|  | 			return | ||||||
|  | 		} | ||||||
| 		if argslen < 2 { | 		if argslen < 2 { | ||||||
| 			fmt.Fprint(os.Stderr, "Error: You need to provide the command to be added") | 			fmt.Fprint(os.Stderr, "Error: You need to provide the command to be added") | ||||||
|  |  | ||||||
| @@ -149,6 +154,7 @@ func main() { | |||||||
| 		} | 		} | ||||||
| 		q := args[1] | 		q := args[1] | ||||||
| 		search(conn, q) | 		search(conn, q) | ||||||
|  | 		os.Exit(23) | ||||||
| 	} else if cmd == "init" { | 	} else if cmd == "init" { | ||||||
| 		err := os.MkdirAll(filepath.Dir(databaseLocation()), 0755) | 		err := os.MkdirAll(filepath.Dir(databaseLocation()), 0755) | ||||||
| 		if err != nil { | 		if err != nil { | ||||||
|   | |||||||
		在新工单中引用
	
	屏蔽一个用户
	 lawl
					lawl