]> gitweb.michael.orlitzky.com - hath.git/blob - hath.cabal
hath.cabal: drop a word and a period from the synopsis
[hath.git] / hath.cabal
1 cabal-version: 3.0
2 name: hath
3 version: 0.5.8
4 author: Michael Orlitzky
5 maintainer: Michael Orlitzky <michael@orlitzky.com>
6 homepage: https://michael.orlitzky.com/code/hath.xhtml
7 bug-reports: mailto:michael@orlitzky.com
8 category: Utils
9 license: AGPL-3.0-or-later
10 license-file: doc/LICENSE
11 build-type: Simple
12 extra-source-files:
13 doc/COPYING
14 doc/man1/hath.1
15 test/shell/*.test
16 synopsis:
17 Hath manipulates network blocks in CIDR notation.
18 description:
19 Hath is a Haskell program for working with network blocks in CIDR
20 notation. When dealing with blocks of network addresses, there are a
21 few things that one usually wants to do with them:
22
23 * Create a regular expression matching the CIDR block(s). This is
24 because grep will throw up if you feed it CIDR.
25
26 * Combine small blocks into larger ones. For example, if you have two
27 consecutive \/24s, they might combine into a larger \/23.
28
29 * View the result of block combination in a useful way.
30
31 * List them.
32
33 Hath has several modes to perform these functions:
34
35 * __Regexed__
36 This computes a (Perl-compatible) regular expression matching
37 the input CIDR blocks. It's the default mode of operation.
38
39 * __Reduced__
40 This combines small blocks into larger ones where possible, and
41 eliminates redundant blocks. The output should be equivalent to
42 the input, though.
43
44 * __Duped__
45 Shows only the blocks that would be removed by reduce; that is, it
46 shows the ones that would get combined into larger blocks or are
47 simply redundant.
48
49 * __Diffed__
50 Shows what would change if you used reduce. Uses diff-like
51 notation.
52
53 * __Listed__
54 List the IP addresses contained within the given CIDRs.
55
56 /Examples/:
57
58 Compute a (Perl-compatible) regular expression matching
59 the input CIDR blocks. It's the default mode of operation.
60
61 @
62 $ echo \"10.0.0.0\/29 10.0.0.8\/29\" | hath
63 ((10)\.(0)\.(0)\.(15|14|13|12|11|10|9|8|7|6|5|4|3|2|1|0))
64 @
65
66 Combine two \/24s into a \/23:
67
68 @
69 $ echo \"10.0.0.0\/24 10.0.1.0\/24\" | hath reduced
70 10.0.0.0/23
71 @
72
73 List the addresses in 192.168.0.240\/29:
74
75 @
76 $ echo 192.168.0.240\/29 | hath listed
77 192.168.0.240
78 192.168.0.241
79 192.168.0.242
80 192.168.0.243
81 192.168.0.244
82 192.168.0.245
83 192.168.0.246
84 192.168.0.247
85 @
86
87 The command-line syntax and complete set of options are documented in
88 the man page.
89
90
91 executable hath
92 default-language:
93 Haskell2010
94
95 main-is:
96 Main.hs
97
98 hs-source-dirs:
99 src/
100
101 other-modules:
102 Bit
103 Cidr
104 CommandLine
105 ExitCodes
106 IPv4Address
107 Maskable
108 Maskbits
109 Octet
110 Paths_hath
111
112 autogen-modules:
113 Paths_hath
114
115 build-depends:
116 base >= 4.15 && < 5.0,
117 cmdargs >= 0.10,
118 split >= 0.2,
119 tasty >= 0.8,
120 tasty-hunit >= 0.8,
121 tasty-quickcheck >= 0.8.1
122
123
124 test-suite testsuite
125 type: exitcode-stdio-1.0
126 hs-source-dirs: src test
127 default-language: Haskell2010
128 main-is: TestSuite.hs
129
130 other-modules:
131 Bit
132 Cidr
133 IPv4Address
134 Maskable
135 Maskbits
136 Octet
137
138 build-depends:
139 base >= 4.15 && < 5.0,
140 split >= 0.2,
141 tasty >= 0.8,
142 tasty-hunit >= 0.8,
143 tasty-quickcheck >= 0.8.1
144
145
146 -- These won't work without shelltestrunner installed in your
147 -- $PATH. Maybe there is some way to tell Cabal that.
148 test-suite shelltests
149 type: exitcode-stdio-1.0
150 hs-source-dirs: test
151 default-language: Haskell2010
152 main-is: ShellTests.hs
153
154 build-depends:
155 base >= 4.15 && < 5.0,
156 process >= 1.1
157
158
159 source-repository head
160 type: git
161 location: https://gitweb.michael.orlitzky.com/hath.git
162 branch: master