forked from simonmichael/hledger
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
imp: Support tsv and ssv prefixes (simonmichael#2164)
- Loading branch information
1 parent
91f4da1
commit 3e33c94
Showing
10 changed files
with
118 additions
and
34 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
#!/bin/sh | ||
# | ||
# sh version, ported from bash so freebsd users can run these tests. | ||
# This scripts expects stdin formatted like this: | ||
# <multi-line ssv file (at least one line required, even if blank)> | ||
# RULES | ||
# <multi-line rules> | ||
# | ||
# Here, unlike in csvtest.sh, the ssv extension is intentionally NOT set | ||
# This allows us to verify that the prefix detection is working | ||
|
||
cat > t.$$.input | ||
sed '1,/^RULES/d' t.$$.input > t.$$.rules | ||
sed '/^RULES/,$d' t.$$.input > t.$$ | ||
|
||
trap 'rm -f t.$$.input t.$$ t.$$.rules t.$$.stderr' EXIT | ||
|
||
# Remove variable file name from error messages | ||
mkfifo t.$$.stderr | ||
sed -Ee "s/t\.$$/input/" t.$$.stderr >&2 & | ||
|
||
hledger -f ssv:t.$$ print "$@" 2> t.$$.stderr |