bin: add-ons compile script
This commit is contained in:
		
							parent
							
								
									a22d56ee28
								
							
						
					
					
						commit
						031cad9497
					
				
							
								
								
									
										28
									
								
								bin/README
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								bin/README
									
									
									
									
									
								
							| @ -1,13 +1,23 @@ | |||||||
| hledger add-on commands, hledger-related scripts, developer builds. | hledger add-on commands, hledger-related scripts, developer builds. | ||||||
| 
 | 
 | ||||||
| Scripts named hledger-* are hledger add-on commands. You can run them directly, | Scripts named hledger-* are hledger add-on commands. The ones in this | ||||||
| or via "hledger [HLEDGEROPTS] ADDONCMD [-- ADDONOPTS]". You should: | bin/ directory are tested along with hledger, but shipped as add-ons | ||||||
| 1. add this directory to your $PATH | rather than built-in commands because they are experimental, or | ||||||
| 2. ensure the scripts have executable permission (they should already, at least on unix) | for some other reason. | ||||||
| 3. optionally, compile them for quicker startup |  | ||||||
| See also: http://hledger.org/hledger.html#add-on-commands |  | ||||||
| 
 | 
 | ||||||
| Other hledger-related scripts include bash aliases, makefile examples, etc. | Add this directory to your $PATH and they will show up as commands | ||||||
|  | listed by hledger (or, you can run them directly). | ||||||
|  | To speed them up (recommended), compile them: | ||||||
| 
 | 
 | ||||||
| hledger development-related binaries also are stored here, such as | $ bin/compile.sh | ||||||
| old versions for benchmarking, and platform-specific binaries. | 
 | ||||||
|  | When using hledger to run add-on commands, remember to use a -- | ||||||
|  | before add-on-specific options or hledger will complain. Like so: | ||||||
|  | 
 | ||||||
|  | $ hledger [HLEDGEROPTS] ADDONCMD [-- ADDONOPTS] | ||||||
|  | 
 | ||||||
|  | See also http://hledger.org/hledger.html#add-on-commands . | ||||||
|  | 
 | ||||||
|  | hledger-related bash scripts, example make rules etc. are also kept here. | ||||||
|  | And hledger developer binaries may get stored here, | ||||||
|  | such as old versions for benchmarking, and platform-specific binaries. | ||||||
|  | |||||||
							
								
								
									
										8
									
								
								bin/compile.sh
									
									
									
									
									
										Executable file
									
								
							
							
						
						
									
										8
									
								
								bin/compile.sh
									
									
									
									
									
										Executable file
									
								
							| @ -0,0 +1,8 @@ | |||||||
|  | #!/bin/sh | ||||||
|  | cd "$(dirname "$0")" | ||||||
|  | echo "building dependencies" | ||||||
|  | stack build hledger | ||||||
|  | echo "building add-on commands" | ||||||
|  | for f in hledger-*.hs; do stack ghc $f; done | ||||||
|  | echo "add-on commands available:" | ||||||
|  | ls -F hledger-* | grep -vE '\.(hs|hi|o)' | ||||||
| @ -3,15 +3,16 @@ | |||||||
|    --package hledger-lib |    --package hledger-lib | ||||||
|    --package hledger |    --package hledger | ||||||
| -} | -} | ||||||
| -- You can compile this script for speed: | {- | ||||||
| -- stack build hledger && stack ghc bin/hledger-check-dates.hs |  | ||||||
| 
 | 
 | ||||||
| {-| |  | ||||||
| hledger-check-dates [--strict] [--date2] [-f JOURNALFILE] | hledger-check-dates [--strict] [--date2] [-f JOURNALFILE] | ||||||
| 
 | 
 | ||||||
| Check that transactions' date are monotonically increasing. | Check that transactions' date are monotonically increasing. | ||||||
| Reads the default or specified journal. | With --strict, dates must also be unique. | ||||||
| |-} | With --date2, checks transactions' secondary dates. | ||||||
|  | Reads the default journal file, or another specified with -f. | ||||||
|  | 
 | ||||||
|  | -} | ||||||
| 
 | 
 | ||||||
| import Hledger | import Hledger | ||||||
| import Hledger.Cli | import Hledger.Cli | ||||||
|  | |||||||
| @ -4,10 +4,8 @@ | |||||||
|    --package hledger |    --package hledger | ||||||
|    --package time |    --package time | ||||||
| -} | -} | ||||||
| -- You can compile this script for speed: |  | ||||||
| -- stack build hledger && stack ghc bin/hledger-equity.hs |  | ||||||
| 
 |  | ||||||
| {- | {- | ||||||
|  | 
 | ||||||
| hledger-equity [HLEDGEROPTS] [QUERY] | hledger-equity [HLEDGEROPTS] [QUERY] | ||||||
| 
 | 
 | ||||||
| Show a "closing balances" transaction that brings the balance of the | Show a "closing balances" transaction that brings the balance of the | ||||||
|  | |||||||
| @ -3,10 +3,8 @@ | |||||||
|    --package hledger-lib |    --package hledger-lib | ||||||
|    --package hledger |    --package hledger | ||||||
| -} | -} | ||||||
| -- You can compile this script for speed: |  | ||||||
| -- stack build hledger && stack ghc bin/hledger-print-unique.hs |  | ||||||
| 
 |  | ||||||
| {- | {- | ||||||
|  | 
 | ||||||
| hledger-print-unique [-f JOURNALFILE | -f-] | hledger-print-unique [-f JOURNALFILE | -f-] | ||||||
| 
 | 
 | ||||||
| Print only journal entries which are unique by description (or | Print only journal entries which are unique by description (or | ||||||
|  | |||||||
| @ -4,10 +4,8 @@ | |||||||
|    --package hledger |    --package hledger | ||||||
|    --package text |    --package text | ||||||
| -} | -} | ||||||
| -- You can compile this script for speed: | {- | ||||||
| -- stack build hledger && stack ghc bin/hledger-register-match.hs |  | ||||||
| 
 | 
 | ||||||
| {-| |  | ||||||
| hledger-register-match DESC | hledger-register-match DESC | ||||||
| 
 | 
 | ||||||
| A helper for ledger-autosync. This prints the one posting whose transaction | A helper for ledger-autosync. This prints the one posting whose transaction | ||||||
| @ -15,7 +13,7 @@ description is closest to DESC, in the style of the register command. | |||||||
| If there are multiple equally good matches, it shows the most recent. | If there are multiple equally good matches, it shows the most recent. | ||||||
| Query options (options, not arguments) can be used to restrict the search space. | Query options (options, not arguments) can be used to restrict the search space. | ||||||
| 
 | 
 | ||||||
| |-} | -} | ||||||
| 
 | 
 | ||||||
| {-# LANGUAGE OverloadedStrings #-} | {-# LANGUAGE OverloadedStrings #-} | ||||||
| 
 | 
 | ||||||
|  | |||||||
| @ -5,10 +5,8 @@ | |||||||
|   --package megaparsec |   --package megaparsec | ||||||
|   --package text |   --package text | ||||||
| -} | -} | ||||||
| -- You can compile this script for speed: | {- | ||||||
| -- stack build hledger && stack ghc bin/hledger-rewrite.hs |  | ||||||
| 
 | 
 | ||||||
| {-| |  | ||||||
| hledger-rewrite [PATTERNS] --add-posting "ACCT  AMTEXPR" ... | hledger-rewrite [PATTERNS] --add-posting "ACCT  AMTEXPR" ... | ||||||
| 
 | 
 | ||||||
| A start at a generic rewriter of journal entries. | A start at a generic rewriter of journal entries. | ||||||
| @ -32,7 +30,7 @@ TODO: | |||||||
| - should apply the rule for each matched posting within a transaction, if there's more than one | - should apply the rule for each matched posting within a transaction, if there's more than one | ||||||
| - should be possible to use this on unbalanced entries, eg while editing one | - should be possible to use this on unbalanced entries, eg while editing one | ||||||
| 
 | 
 | ||||||
| |-} | -} | ||||||
| 
 | 
 | ||||||
| import qualified Data.Text as T | import qualified Data.Text as T | ||||||
| -- hledger lib, cli and cmdargs utils | -- hledger lib, cli and cmdargs utils | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user