]> gitweb.michael.orlitzky.com - hath.git/blob - hath.cabal
Add a type signature to a local function definition.
[hath.git] / hath.cabal
1 name: hath
2 version: 0.3.1
3 cabal-version: >= 1.8
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 homepage: http://michael.orlitzky.com/code/hath.php
7 category: Utils
8 license: AGPL-3
9 license-file: doc/LICENSE
10 build-type: Simple
11 extra-source-files:
12 doc/man1/hath.1
13 test/shell/*.test
14 synopsis:
15 Hath manipulates network blocks in CIDR notation.
16 description:
17 Hath is a Haskell program for working with network blocks in CIDR
18 notation. When dealing with blocks of network addresses, there are a
19 few things that one usually wants to do with them:
20 .
21 * Create a regular expression matching the CIDR block(s). This is
22 because grep will throw up if you feed it CIDR.
23 .
24 * Combine small blocks into larger ones. For example, if you have two
25 consecutive \/24s, they might combine into a larger \/23.
26 .
27 * View the result of block combination in a useful way.
28 .
29 * List them.
30 .
31 Hath has several modes to perform these functions:
32 .
33 [@Regexed@]
34 This computes a (Perl-compatible) regular expression matching
35 the input CIDR blocks. It's the default mode of operation.
36 .
37 [@Reduced@]
38 This combines small blocks into larger ones where possible, and
39 eliminates redundant blocks. The output should be equivalent to
40 the input, though.
41 .
42 [@Duped@]
43 Shows only the blocks that would be removed by reduce; that is, it
44 shows the ones that would get combined into larger blocks or are
45 simply redundant.
46 .
47 [@Diffed@]
48 Shows what would change if you used reduce. Uses diff-like
49 notation.
50 .
51 [@Listed@]
52 List the IP addresses contained within the given CIDRs.
53 .
54 /Examples/:
55 .
56 Compute a (Perl-compatible) regular expression matching
57 the input CIDR blocks. It's the default mode of operation.
58 .
59 @
60 $ echo \"10.0.0.0\/29 10.0.0.8\/29\" | hath
61 ((10)\.(0)\.(0)\.(15|14|13|12|11|10|9|8|7|6|5|4|3|2|1|0))
62 @
63 .
64 Combine two \/24s into a \/23:
65 .
66 @
67 $ echo \"10.0.0.0\/24 10.0.1.0\/24\" | hath reduced
68 10.0.0.0/23
69 @
70 .
71 List the addresses in 192.168.0.240\/29:
72 .
73 @
74 $ echo 192.168.0.240\/29 | hath listed
75 192.168.0.240
76 192.168.0.241
77 192.168.0.242
78 192.168.0.243
79 192.168.0.244
80 192.168.0.245
81 192.168.0.246
82 192.168.0.247
83 @
84 .
85 The command-line syntax and complete set of options are documented in
86 the man page.
87
88
89 executable hath
90
91 main-is:
92 Main.hs
93
94 hs-source-dirs:
95 src/
96
97 other-modules:
98 Bit
99 Cidr
100 CommandLine
101 ExitCodes
102 IPv4Address
103 Maskable
104 Maskbits
105 Octet
106
107 build-depends:
108 base == 4.*,
109 cmdargs >= 0.10,
110 MissingH >= 1.2,
111 split >= 0.2,
112 tasty >= 0.8,
113 tasty-hunit >= 0.8,
114 tasty-quickcheck >= 0.8.1
115
116 ghc-options:
117 -Wall
118 -fwarn-hi-shadowing
119 -fwarn-missing-signatures
120 -fwarn-name-shadowing
121 -fwarn-orphans
122 -fwarn-type-defaults
123 -fwarn-tabs
124 -fwarn-incomplete-record-updates
125 -fwarn-monomorphism-restriction
126 -fwarn-unused-do-bind
127 -rtsopts
128 -threaded
129 -optc-O3
130 -optc-march=native
131 -O2
132
133 ghc-prof-options:
134 -prof
135 -auto-all
136 -caf-all
137
138
139 test-suite testsuite
140 type: exitcode-stdio-1.0
141 hs-source-dirs: src test
142 main-is: TestSuite.hs
143
144 build-depends:
145 base == 4.*,
146 cmdargs >= 0.10,
147 MissingH >= 1.2,
148 split >= 0.2,
149 tasty >= 0.8,
150 tasty-hunit >= 0.8,
151 tasty-quickcheck >= 0.8.1
152
153
154 -- It's not entirely clear to me why I have to reproduce all of this.
155 ghc-options:
156 -Wall
157 -fwarn-hi-shadowing
158 -fwarn-missing-signatures
159 -fwarn-name-shadowing
160 -fwarn-orphans
161 -fwarn-type-defaults
162 -fwarn-tabs
163 -fwarn-incomplete-record-updates
164 -fwarn-monomorphism-restriction
165 -fwarn-unused-do-bind
166 -rtsopts
167 -threaded
168 -optc-O3
169 -optc-march=native
170 -O2
171
172
173 -- These won't work without shelltestrunner installed in your
174 -- $PATH. Maybe there is some way to tell Cabal that.
175 test-suite shelltests
176 type: exitcode-stdio-1.0
177 hs-source-dirs: test
178 main-is: ShellTests.hs
179
180 build-depends:
181 base == 4.*,
182 cmdargs >= 0.10,
183 MissingH >= 1.2,
184 process >= 1.1,
185 split >= 0.2,
186 tasty >= 0.8,
187 tasty-hunit >= 0.8,
188 tasty-quickcheck >= 0.8.1
189
190 -- It's not entirely clear to me why I have to reproduce all of this.
191 ghc-options:
192 -Wall
193 -fwarn-hi-shadowing
194 -fwarn-missing-signatures
195 -fwarn-name-shadowing
196 -fwarn-orphans
197 -fwarn-type-defaults
198 -fwarn-tabs
199 -fwarn-incomplete-record-updates
200 -fwarn-monomorphism-restriction
201 -fwarn-unused-do-bind
202 -rtsopts
203 -threaded
204 -optc-O3
205 -optc-march=native
206 -O2
207
208 source-repository head
209 type: git
210 location: http://michael.orlitzky.com/git/hath.git
211 branch: master