Skip to content

kendfss/namespacer

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

namespacer

CLI to avoid over-writing file-sytem names which already exist.
It is insensitive to argument type (file/directory).

Installation

go install github.com/kendfss/namespacer

Or

git clone github.com/kendfss/namespacer
cd namespacer
go install

Or

git clone github.com/kendfss/namespacer
cd namespacer
make install

Usage

It accepts three arguments:

  • path: to the file/directory
  • format: string that specifies the pattern that spaced names should extend with
  • index: the first number to try if the path argument already exists
namespacer main.go 
# returns "main_2.go" if main.go already exists
namespacer -path main.go -format " (%v)" -index 3 
# "main (3).go"
namespacer main.go " v%d" 40 
# main v40.go
namespacer main.go " v%x" 40 
# main v28.go
namespacer main.go " v%b" 40 
# main v101000.go

About

clibrary to protect from file system collisions

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published