Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Handling long lines in content of internet-drafts and RFCs

License

NotificationsYou must be signed in to change notification settings

ietf-tools/rfcfold

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

69 Commits
 
 
 
 
 
 
 
 
 
 
 
 

rfcfold is aBashscript that folds or unfolds a text file according toRFC 8792,Handling Long Lines in Content of Internet-Drafts and RFCs.The (un)folding operations are implemented withgrep andsed.

rfcfold Usage

Invokingrfcfold with the-h option shows usage information:

Folds or unfolds the input text file according to RFC 8792.Usage: rfcfold [-h] [-V] [-d] [-q] [-s <strategy>] [-c <col>] [-r] -i <infile> -o <outfile>  -s: strategy to use, '1' or '2' (default: try 1, else 2)  -c: column to fold on (default: 69)  -r: reverses the operation  -i: the input filename  -o: the output filename  -d: show debug messages (unless -q is given)  -q: quiet (suppress error and debug messages)  -h: show this message  -V: print version informationExit status code: 1 on error, 0 on success, 255 on no-op.

Examples

  1. Fold the fileoriginal.txt and write the result tofolded.txt:

    rfcfold -i original.txt -o folded.txt

  2. Unfold the filefolded.txt and write the result tounfolded.txt:

    rfcfold -r -i folded.txt -o unfolded.txt

Changes between versions

Noteworthy changes between versions ofrfcfold can be found in theNEWS.md file.

Limitations

rfcfold has some limitations, because its primary intended use is fortext file inclusions in IETF RFC and Internet-Draft (I-D) documents, andbecause it is implemented as a Bash script relying ongrep andsed.

TAB is Prohibited

The primary application ofrfcfold lies in creating text files thatcan be included in IETF RFC and I-D documents by ensuring a maximum linelength (in characters). Thus the input file is not allowed to containTAB characters, because they are not allowed for text fragments in an RFC.

ASCII Control and Non-ASCII is Unsupported

Most ASCII control characters and non-ASCII characters are problematicin the context of IETF RFC and I-D documents, andrfcfold emits awarning if it finds them in the input data. IETF RFC and I-D documentsallow limited use of UTF-8 encoded Unicode characters, butrfcfolddoes not take Unicode specifics into account.

Unicode is Unsupported

Depending on the operating system respectively the availablegrep andsed implementations,rfcfold may be able to process Unicode textfiles, but with limitations. The display width of Unicode characters isnot taken into consideration when folding. Every character is assumedto have single width. Since printable Unicode characters can be widerthan single width, and some implementations even display some singlewidth characters with more than single width, the end result may notlook as expected. There are additional complications with Unicode, e.g.,combining characters, none of which are taken into account byrfcfold.As such Unicode is notsupported byrfcfold.

grep and sed

Usage of bothgrepandsedconforms to thePOSIXspecification.

On non-GNU systems, GNU tools are ofteninstalled to complement the system-provided ones. On such systems,GNU grepandGNU sedare used if they are available asggrep andgsed.

Use of both GNU grep and GNU sed may increase the maximum usable valuefor the folding column over using system-provided grep and sed.

About

Handling long lines in content of internet-drafts and RFCs

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Languages


[8]ページ先頭

©2009-2026 Movatter.jp