diff --git a/CLI.md b/CLI.md index eefb5dc..862eb2e 100644 --- a/CLI.md +++ b/CLI.md @@ -64,6 +64,18 @@ python -c "from stegasoo import has_dct_support; print('DCT:', 'available' if ha stegasoo channel show ``` +### Man Page + +```bash +# Install man page +sudo mkdir -p /usr/local/share/man/man1 +sudo cp docs/stegasoo.1 /usr/local/share/man/man1/ +sudo mandb + +# View +man stegasoo +``` + --- ## What's New in v4.1.0 diff --git a/README.md b/README.md index bf489af..64efa7b 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ See [rpi/README.md](rpi/README.md) for manual installation. - [UNDER_THE_HOOD.md](UNDER_THE_HOOD.md) - Technical deep-dive - [CHANGELOG.md](CHANGELOG.md) - Version history - [CONTRIBUTING.md](CONTRIBUTING.md) - Contributor guide +- `man stegasoo` - Man page (install: `sudo cp docs/stegasoo.1 /usr/local/share/man/man1/ && sudo mandb`) ## License diff --git a/docs/stegasoo.1 b/docs/stegasoo.1 index 3328cff..66e8a9e 100644 --- a/docs/stegasoo.1 +++ b/docs/stegasoo.1 @@ -57,12 +57,6 @@ Passphrase (recommend 4+ words). Prompts if not provided. .B \-\-pin " " \fITEXT\fR PIN code. Prompts if not provided. .TP -.B \-\-compress\fR/\fB\-\-no\-compress -Enable/disable compression (default: enabled). -.TP -.B \-\-algorithm " " [\fIzlib\fR|\fIlz4\fR|\fInone\fR] -Compression algorithm. -.TP .B \-\-dry\-run Show capacity usage without encoding. .PP @@ -143,7 +137,7 @@ Encode message into multiple images. [\fIoptions\fR] .PP Options: \fB\-m\fR, \fB\-f\fR, \fB\-o\fR/\fB\-\-output\-dir\fR, \fB\-\-suffix\fR, \fB\-\-passphrase\fR, \fB\-\-pin\fR, -\fB\-\-compress\fR, \fB\-\-algorithm\fR, \fB\-r\fR/\fB\-\-recursive\fR, \fB\-j\fR/\fB\-\-jobs\fR, \fB\-v\fR/\fB\-\-verbose\fR. +\fB\-r\fR/\fB\-\-recursive\fR, \fB\-j\fR/\fB\-\-jobs\fR, \fB\-v\fR/\fB\-\-verbose\fR. .RE .TP .B batch decode diff --git a/rpi/setup.sh b/rpi/setup.sh index ef6dbed..1d5a1e2 100755 --- a/rpi/setup.sh +++ b/rpi/setup.sh @@ -428,6 +428,14 @@ if [ -f "$INSTALL_DIR/rpi/skel/.bashrc" ]; then fi fi +# Install man page +if [ -f "$INSTALL_DIR/docs/stegasoo.1" ]; then + sudo mkdir -p /usr/local/share/man/man1 + sudo cp "$INSTALL_DIR/docs/stegasoo.1" /usr/local/share/man/man1/ + sudo mandb -q 2>/dev/null || true + echo " Installed man page (man stegasoo)" +fi + echo -e "${GREEN}[12/12]${NC} Setting up login banner..." # Create dynamic MOTD script diff --git a/src/stegasoo/cli.py b/src/stegasoo/cli.py index d6509d9..ef06ed5 100644 --- a/src/stegasoo/cli.py +++ b/src/stegasoo/cli.py @@ -80,12 +80,6 @@ from .batch import ( batch_capacity_check, print_batch_result, ) -from .compression import ( - HAS_LZ4, - CompressionAlgorithm, - algorithm_name, - get_available_algorithms, -) from .constants import ( DEFAULT_PASSPHRASE_WORDS, # v3.2.0: renamed from DEFAULT_PHRASE_WORDS DEFAULT_PIN_LENGTH, @@ -183,19 +177,10 @@ def cli(ctx, json_output): help="Passphrase (recommend 4+ words)", ) @click.option("--pin", prompt=True, hide_input=True, confirmation_prompt=True, help="PIN code") -@click.option( - "--compress/--no-compress", default=True, help="Enable/disable compression (default: enabled)" -) -@click.option( - "--algorithm", - type=click.Choice(["zlib", "lz4", "none"]), - default="zlib", - help="Compression algorithm", -) @click.option("--dry-run", is_flag=True, help="Show capacity usage without encoding") @click.pass_context def encode( - ctx, carrier, reference, message, file_payload, output, passphrase, pin, compress, algorithm, dry_run + ctx, carrier, reference, message, file_payload, output, passphrase, pin, dry_run ): """ Encode a message or file into an image. @@ -214,18 +199,6 @@ def encode( if not message and not file_payload: raise click.UsageError("Either --message or --file is required") - # Parse compression algorithm - algo_map = { - "zlib": CompressionAlgorithm.ZLIB, - "lz4": CompressionAlgorithm.LZ4, - "none": CompressionAlgorithm.NONE, - } - compression_algo = algo_map[algorithm] if compress else CompressionAlgorithm.NONE - - if algorithm == "lz4" and not HAS_LZ4: - click.echo("Warning: LZ4 not available, falling back to zlib", err=True) - compression_algo = CompressionAlgorithm.ZLIB - # Calculate payload size if file_payload: payload_size = Path(file_payload).stat().st_size @@ -247,7 +220,6 @@ def encode( "capacity_bytes": capacity_bytes, "payload_type": payload_type, "payload_size": payload_size, - "compression": algorithm_name(compression_algo), "usage_percent": round(payload_size / capacity_bytes * 100, 1), "fits": payload_size < capacity_bytes, } @@ -259,7 +231,6 @@ def encode( click.echo(f"Reference: {reference}") click.echo(f"Capacity: {capacity_bytes:,} bytes ({capacity_bytes//1024} KB)") click.echo(f"Payload: {payload_size:,} bytes ({payload_type})") - click.echo(f"Compression: {algorithm_name(compression_algo)}") click.echo(f"Usage: {result['usage_percent']}%") click.echo(f"Status: {'✓ Fits' if result['fits'] else '✗ Too large'}") return @@ -306,7 +277,6 @@ def encode( "reference": reference, "output": output, "payload_type": payload_type, - "compression": algorithm_name(compression_algo), }, indent=2, ) @@ -314,7 +284,6 @@ def encode( else: click.echo(f"✓ Encoded {payload_type} to {output}") click.echo(f" Reference: {reference}") - click.echo(f" Compression: {algorithm_name(compression_algo)}") except Exception as e: if ctx.obj.get("json"): @@ -474,13 +443,6 @@ def batch(): help="Passphrase (recommend 4+ words)", ) @click.option("--pin", prompt=True, hide_input=True, confirmation_prompt=True, help="PIN code") -@click.option("--compress/--no-compress", default=True, help="Enable/disable compression") -@click.option( - "--algorithm", - type=click.Choice(["zlib", "lz4", "none"]), - default="zlib", - help="Compression algorithm", -) @click.option("-r", "--recursive", is_flag=True, help="Search directories recursively") @click.option("-j", "--jobs", default=4, help="Parallel workers (default: 4)") @click.option("-v", "--verbose", is_flag=True, help="Show detailed output") @@ -494,8 +456,6 @@ def batch_encode( suffix, passphrase, pin, - compress, - algorithm, recursive, jobs, verbose, @@ -530,7 +490,6 @@ def batch_encode( output_dir=Path(output_dir) if output_dir else None, output_suffix=suffix, credentials=credentials, - compress=compress, recursive=recursive, progress_callback=progress if not ctx.obj.get("json") else None, ) @@ -821,10 +780,6 @@ def info(ctx, full): "fingerprint": channel_fingerprint, "source": channel_source, } if channel_fingerprint else None, - "compression": { - "available": [algorithm_name(a) for a in get_available_algorithms()], - "lz4_installed": HAS_LZ4, - }, "limits": { "max_message_bytes": MAX_MESSAGE_SIZE, "max_file_payload_bytes": MAX_FILE_PAYLOAD_SIZE,