Module: Modname

Defined in:
lib/modname.rb,
lib/modname/banner.rb,
lib/modname/version.rb

Overview

Modname is a versatile file naming tool for renaming groups of files

Defined Under Namespace

Classes: Driver

Constant Summary collapse

HELP_BANNER =
<<~HELP.freeze
  #{'Usage:'.cyan} modname [options] <match> [transform]

  #{'modname | rename files, fast'.cyan}
  #{'--------┼----------------------------'.cyan}
       -e #{'|'.cyan} change file extensions
       -f #{'|'.cyan} force run; don't pre-check
       -r #{'|'.cyan} run modname recursively
       -h #{'|'.cyan} show more help, examples
HELP
V_HELP_BANNER =
<<~VHELP.freeze
  #{Modname::HELP_BANNER}
  #{'commands'.cyan}
    file names
      [match] [trans] => modify a pattern in filenames
      [match] => delete a pattern from filenames

    extensions (-e)
      [old] [new] => move file extensions, <old> to <new>
      [ext] => lowercase one extension type (EXT => ext)
      nil => move all extensions to lower case

  #{'examples'.cyan}
    file names
      modname hello => deletes 'hello' from all filenames
      modname hello byebye => replace 'hello' with byebye

    extensions (-e)
      modname -e txt md => move all txt files to markdown
      modname -e mov mp4 => move all mov files to mp4

  #{'Note:'.cyan} <required> [optional]
VHELP
VERSION =
'1.0.0'

Class Method Summary collapse

Class Method Details

.run(args) ⇒ Object



14
# File 'lib/modname.rb', line 14

def run(args) = Driver.new.run(args)