Skip to content

This tool finds two set strings in a file and replaces every line between them with the contents of another file.

License

Notifications You must be signed in to change notification settings

svmnotn/miniature-eureka

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

miniature-eureka

This tool finds two set strings in a file and replaces every line between them with the contents of another file.

Usage

miniature-eureka path/to/source path/to/destination --start "SECTION-REPLACE-START" --end "SECTION-REPLACE-END"

Or if you want to search for those specific strings

miniature-eureka path/to/source path/to/destination

If you want to be extra explicit / don't want to provide the arguments in order

miniature-eureka --src path/to/source --dst path/to/destination --start "SECTION-REPLACE-START" --end "SECTION-REPLACE-END"

The arguments are as follows:

  • Source File
    • --src
    • --source
    • The first free standing argument found
  • Destination File
    • --dst
    • --dest
    • --destination
    • The second free standing argument found
  • Start replacing marker
    • --start
    • --start-marker
  • End replacing marker
    • --end
    • --end-marker

The tool also accepts -h and --help

To Dos

  • Perhaps allowing to specify the src / dest file as stdin would be nice
  • Optimization, currently everything is read into a string, I'm sure there is some way to instead replace in place

About

This tool finds two set strings in a file and replaces every line between them with the contents of another file.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages