srd

command
v0.0.4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 8, 2025 License: Apache-2.0 Imports: 5 Imported by: 0

README

SRD Command-Line Tool

A simple command-line tool to apply SRD (Search-Replace-Delete) format patch files to directories.

Installation

cd cmd/srd
go build -o srd

Or install globally:

go install github.com/yxia/axe/cmd/srd@latest

Usage

srd -patch <patch_file> [-dir <target_directory>]
Options
  • -patch <file> (required): Path to the patch file to apply
  • -dir <directory> (optional): Target directory to apply the patch (defaults to current directory)
  • -help: Show help message
Examples

Apply a patch to the current directory:

srd -patch changes.diff

Apply a patch to a specific directory:

srd -patch changes.diff -dir /path/to/project

Apply the example patch:

cd /home/yxia/stumble/axe
srd -patch cmd/examples/great_test_writer/failed_diff.txt -dir cmd/examples/great_test_writer/

Patch Format

The tool uses the SRD patch format. See /code/srd/README.md for detailed documentation on how to write patches.

Quick example:

*** Begin Patch
*** Update File: src/hello.py
 def greet(name):
-    print("Hello")
+    print("Hello, World!")
*** End Patch

Features

  • Add new files
  • Update existing files
  • Delete files
  • Move/rename files
  • Automatic directory creation for new files

Documentation

The Go Gopher

There is no documentation for this package.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL