It made the Makefile more difficult to read and this way we can take advantage of `set -e`, `-o pipefail` and friends. Clean up debugging targets
		
			
				
	
	
		
			14 lines
		
	
	
		
			462 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
			
		
		
	
	
			14 lines
		
	
	
		
			462 B
		
	
	
	
		
			Bash
		
	
	
		
			Executable File
		
	
	
	
	
| #!/usr/bin/env bash
 | |
| # Parse hledger's help and output all commands and command aliases in
 | |
| # parenthesis. Do not output single letter command aliases, it's not useful.
 | |
| set -euo pipefail
 | |
| 
 | |
| declare commands_help
 | |
| commands_help=$(hledger)
 | |
| {
 | |
|     sed -rn 's/^\s+([a-z][-a-z]+)\s+.*/\1/p' <<< "$commands_help"
 | |
|     sed -rn 's/^\s+[a-z][-a-z]+\s+\(([a-z][ ,a-z]+)\).*/\1/p' <<< "$commands_help" |
 | |
|     sed 's/\s*,\s*/\n/g' |
 | |
|     sed '/^.$/d'
 | |
| } | sed '/^hledger/d' | sort -u
 |