shrup

Crates.ioshrup
lib.rsshrup
version0.1.0
created_at2025-08-20 18:51:36.7754+00
updated_at2025-08-20 18:51:36.7754+00
descriptionA shell script preprocessor
homepage
repositoryhttps://github.com/kp63/shrup
max_upload_size
id1803811
size92,336
(kp63)

documentation

README

shrup - A shell script preprocessor

Simple, Fast, Lightweight shell script preprocessor

  • Simple → シンプルでトリセツのいらない仕様
  • Fast → Rust製故の超高速な処理
  • Lightweight → 1kB未満のバイナリサイズ

自分用に作成したシェルスクリプト作成支援ツールです。 C言語のプリプロセッサーのように、ファイル内の#includeディレクティブを解決して結合できます。 一応シェルスクリプト以外でも使えます。

スクリーンショット

使用例

機能

  • 循環参照検出
  • デバッグモード(--debugでincludeコメント表示)

ディレクティブ

  • #include <file> → ファイルを解決して結合

使用方法

shrup input.sh output.sh [--debug] [--max-depth N]
# --debug, -d → デバッグモード(includeの情報を出力に含める)

ビルド

cargo build --release
# バイナリは target/release/shrup に生成されます

テスト

cargo test

Include記法

#include <utils/functions.sh>    # 山括弧
#include "config/settings.sh"    # ダブルクオート  
#include 'helpers/logger.sh'     # シングルクオート
#include common.sh               # クオートなし

ライセンス

MIT License

Commit count: 4

cargo fmt