Skip to content

brename v2.2.0

Compare
Choose a tag to compare
@shenwei356 shenwei356 released this 05 May 14:00
· 79 commits to master since this release

Changelog

  • Add supporting replace with ascending integer ({nr} in value of flag -r/--replacement)

      $ brename -p '(.+)\.' -r 'pic-{nr}.' -f .jpg
      [INFO] checking: [ ok ] 'AA.jpg' -> 'pic-1.jpg'
      [INFO] checking: [ ok ] 'b.jpg' -> 'pic-2.jpg'
      [INFO] 2 path(s) to be renamed
    
  • Add supporting renaming submatch with corresponding value via key-value file (-k/--kv-file) ({kv} in value of flag -r/--replacement)

      $ more kv.tsv
      a       一
      b       二
      c       三
    
      $ brename -p '^(\w)' -r '{kv}' -k kv.tsv -K -i  -d
      [INFO] read key-value file: kv.tsv
      [INFO] 3 pairs of key-value loaded
      [INFO] checking: [ ok ] 'AA.jpg' -> '一A.jpg'
      [INFO] checking: [ ok ] 'b.jpg' -> '二.jpg'
      [WARN] checking: [ unchanged ] 'hello b.html' -> 'hello b.html'
      [WARN] checking: [ unchanged ] 'kv.tsv' -> 'kv.tsv'