oneonestar / uppercaser

Simple C app to show how to manipulate streams

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Linux System Programming - Rotate by 13 places (ROT13)

A small program that performs rotate by 13 places ``encryption''.

Compile & Run

Compile executable. You should have a gnu11 compatible compiler (eg. Clang).

$ git clone https://github.com/oneonestar/LSP_ROT13.git
$ cd LSP_ROT13
$ mkdir build
$ cmake ..
$ make
$ ./ROT13

Compile document You need to install asciidoc and asciidoctor.

$ cd ../doc
# Generate manpage
$ a2x --doctype manpage --format manpage ROT13.1.adoc
# Generate html manpage
$ asciidoctor -d manpage ROT13.1.adoc

Usage

Usage: ROT13 [OPTION…​] [FILE…​]

ROT13 — Rotate by 13 places encryption

-r, --reverse              Reverse shift (right shift)
-s, --shift=AMOUNT         Shift by this AMOUNT (default 13)
-v, --verbose              Verbose Mode
-?, --help                 Give this help list
    --usage                Give a short usage message
-V, --version              Print program version

Mandatory or optional arguments to long options are also mandatory or optional for any corresponding short options.

Tip
If no FILE provided, program will read from standard input.

Example

$ ./ROT13                       #left shift of 13, reading from stdin
$ ./ROT13 -s 10                 #left shift of 10
$ ./ROT13 -r -s 8               #right shift of 8
$ ./ROT13 Makefile              #encrypt the Makefile, output as Makefile.out

License

Copyright (c) 2015 Star Poon

This program is free software: you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.

You should have received a copy of the GNU Affero General Public License along with this program. If not, see http://www.gnu.org/licenses/.

Bugs & Feedback

Report bugs to Star Poon <oneonestar@gmail.com>.

About

Simple C app to show how to manipulate streams

License:GNU Affero General Public License v3.0


Languages

Language:C 98.8%Language:CMake 1.2%