3.3.5.2 Using gnatkr

You invoke the gnatkr command as follows:

$ gnatkr name [ length ]

name is the uncrunched file name, derived from the name of the unit in the default manner described in the previous section (i.e., in particular all dots are replaced by hyphens). You may or may not include an extension (defined as a suffix of the form period followed by arbitrary characters other than period) in the filename. If you do, gnatkr will preserve it in the output. For example, when krunching hellofile.ads to eight characters, the result will be hellofil.ads.

Note: for compatibility with previous versions of gnatkr, you can use dots in the name instead of hyphens, but gnatkr always interprets the last dot as the start of an extension. So if you pass gnatkr an argument such as Hello.World.adb, it treats it exactly as if the first period had been a hyphen, so, for example, krunching to eight characters gives the result hellworl.adb.

Note that the result is always all lower case. Other characters are folded as required.

length represents the length of the krunched name. The default if you don’t specify it, is 8 characters. A length of zero means unlimited, in other words don’t chop except for system files where the implied crunching length is always eight characters.

The output is the krunched name. The output has an extension only if the original argument was a file name with an extension.