Skip to content

sort a file in-place, optionally adding given lines

Notifications You must be signed in to change notification settings

backplane/insort

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

insort

Utility which sorts the given file in-place and optionally inserts the given additions into the file

Usage

The program prints the following usage text when invoked with the -h or --help arguments:

Utility which sorts the given file in-place and optionally inserts the given additions into the file

Usage: insort [OPTIONS] <filename> [additions]...

Arguments:
  <filename>      The file to sort and optionally insert additions into
  [additions]...  Optional string(s) to insert into the file (strings already in the file will not be inserted)

Options:
  -c, --create     Create the output file if it doesn't already exist
  -n, --no-create  Don't create the output file if it doesn't already exist
  -h, --help       Print help
  -V, --version    Print version

Example

Here's an example of adding .env and **/.DS_Store as lines in .gitignore and ensuring that .gitignore is sorted.

$ insort .gitignore '**/.DS_Store' .env
.gitignore sorted and 2 additions inserted.

About

sort a file in-place, optionally adding given lines

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages