"Fossies" - the Fresh Open Source Software Archive

Member "namefix.pl/libs/cli/help.pm" (12 Sep 2009, 6697 Bytes) of package /linux/privat/old/namefix.pl_4.0.2.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Perl source code syntax highlighting (style: standard) with prefixed line numbers and code folding option. Alternatively you can here view or download the uninterpreted source code file. For more information about "help.pm" see the Fossies "Dox" file reference documentation.

    1 # namefix cli help
    2 
    3 use warnings;
    4 use strict;
    5 
    6 sub cli_help
    7 {
    8 
    9 my $mode = shift;
   10 if(!$mode) { $mode = "long"; }
   11 
   12 my $txt_header="namefix.pl $main::version
   13 
   14 I am negelecting cmd line no more.
   15 cli mode is strictly WIP, options likely to change.
   16 most options are implemented - but in need of testing.
   17 have fun.
   18 
   19 namefix-cli.pl -<shortoptions> <target>
   20 namefix-cli.pl --<longoption1> --<longoption2> --<longoption3=value> <target>
   21 namefix-cli.pl -<shortoptions> --<longoption1> --<longoption2=value> <target>
   22 ";
   23 
   24 my $txt_help =
   25 "h  --help          help list
   26     --help-short        Short Help (Most used options)
   27     --help-long     Long Help (Short, Advanced & Misc options)
   28     --help-misc     Misc options
   29     --help-adv      Advance options
   30     --help-mp3      Mp3 options
   31     --help-trunc        Truncate options
   32     --help-enum     Enumerate options
   33     --help-doc      Document and Config options
   34     --help-debug        Debug Options
   35     --help-hacks        Hack options
   36     --help-all      All help (Long list of options)
   37 
   38 ";
   39 
   40 my $txt_main = "Main Options:
   41 
   42 !   --rename        preform rename
   43     --ren           enable once you are happy with preview.
   44                 Without this option namefix defaults to 
   45                 preview mode.
   46 
   47     --undo          undo last rename
   48 
   49 g   --clean         general cleanup (reccomend)
   50 
   51 c   --case          Fix case
   52 p   --spaces        Convert _ and \" \" to set space delimiter
   53                 current space delimiter: \"$main::space_character\"
   54 o   --dots          Dots \".\" to Space Delimiter
   55 x   --regexp        Enable regexp in remove option
   56 
   57     --remove=STRING     Remove STRING from filename
   58     --rm=STRING
   59 
   60     --replace=STRING    Replace removed string with STRING
   61     --rp=STRING     This option will be disabled
   62                 if remove is not invoked
   63 
   64     --append-front=STRING   Append STRING to the start of filename
   65     --af=STRING
   66 
   67     --append-end=STRING Append STRING to the end of filename
   68     --ae=STRING
   69 
   70 C   --case-sp       Use special Casing list:
   71                 $main::casing_file
   72 
   73 K   --rm-words      Remove Custom Words list
   74                 $main::killwords_file
   75 
   76 P   --rm-pat        Remove Custom regexp patterns, ie urls
   77                 $main::killpat_file
   78 
   79 F   --fs-fix        Work around case insensitive filesystems
   80                 eg microsofts fat32
   81 
   82 ";
   83 my $txt_trunc = "Truncate Options:
   84 
   85     --trunc=N       truncate filenames to N length
   86     --trunc-pat=N       Select truncate pattern
   87                 0 = Truncate from Start (Default)
   88                 1 = Truncate from Middle
   89                 2 = Truncate from End
   90 
   91     --trunc-ins=STRING  When using --trunc-pat=1
   92                 Insert STRING in middle of filename
   93 
   94 ";
   95 my $txt_enum =
   96 "Enumerate Options:
   97 
   98     --enum          enumerate filenames
   99     --enum-style=N      Select enumeration method
  100                 0 = Numbers Only (removes filename)
  101                 1 = Insert at start of filename (Default)
  102                 2 = Insert at end of filename.
  103 
  104     --enum-zero-pad=N   N = Pad enum number to N zeros
  105 
  106 ";
  107 my $txt_misc =
  108 "Misc Options:
  109 
  110 i   --int           convert international characters to
  111                 english equivalent
  112 
  113 s   --scene         Scenify Season and Episode Numbers
  114     --sc
  115 
  116 u   --unscene       Unscenify Season and Episode Numbers
  117     --usc
  118 
  119 U   --uc            uppercase all letters of filename
  120 L   --lc            lowercase all letters of filename
  121 
  122     --rm-nc         remove nasty characters
  123     --rmc
  124 
  125     --rm-starting-digits    remove all digits from start of filename
  126     --rsd
  127 
  128     --rm-all-digits     remove all digits from filename
  129     --rad           Excluding file extension
  130 
  131 H   --pad-hyphen        pad / hyphen dashes with space delimiter \"$main::space_character\"
  132     --ph
  133 
  134 N   --pad-num       pad digits with -
  135     --pn            Aimed at track & EpisodexSeason numbers
  136                 eg: \"Artist 10 Title.mp3\" to
  137                 \"Artist - 10 - Title.mp3\"
  138 
  139 0   --pad-num-w0        Pad numbers with zero's
  140     --p0            eg: track & EpisodexSeason numbers
  141                 2x12 to 02x12, 3x4 to 03x05 etc
  142 
  143     --pad-nnnn-wx       Pad SeasonEpisode numbers with x
  144     --px            before: Show 0104 Episode title.avi
  145                 after : Show 01x04 Episode title.avi
  146 
  147 ";
  148 my $txt_advance =
  149 "Advanced Options:
  150 
  151     --save-options      Save current options as default
  152     --save-opt      config file is located at:
  153     --save-config       $main::config_file
  154 
  155     --recr          Recursive mode
  156                 Warning: Use with caution
  157 
  158 D   --dir           process directories
  159                 Warning: Use with caution
  160 
  161     --overwrite     Preform rename without checking if new filename exists.
  162                 Please be carefull witht this option
  163 
  164 A   --all-files     Process all files, not just media files.
  165 
  166     --filt=STRING       Filter files processed. must contain STRING
  167     --filt-regexp       filter STRING is a regexp
  168 
  169     --space-char=C      C = Space Delimiter character
  170     --spc=C         Override default space delimiter \"$main::space_character\"
  171                 and use C
  172 
  173     --media-types=STRING    only process the file extensions listed in STRING
  174     --mt=STRING     STRING format: \"<file_ext1>|<file_ext2>\"
  175                 Default file types processed:
  176                 $main::file_ext_2_proc
  177 
  178 ";
  179 my $txt_hacks =
  180 "Hacks:
  181 
  182     --html          output is formatted as html
  183                 Then viewed in a console mode browser:
  184                 $main::browser
  185 
  186     --browser       set browser to use for html hack
  187 
  188 ";
  189 my $txt_docs =
  190 "Documentation Options
  191 
  192     --help
  193 
  194     --changelog     prints out entire changelog
  195     --about         prints about info
  196     --todo          prints namefix.pl's todo list
  197     --thanks        Credit / Thankyou list of contributors.
  198     --links         Reccomend Links from the author
  199 
  200     --editor=STRING     Set editor to STRING
  201 
  202     --ed-config     Edit namefix.pl's config
  203     --ed-spcase     Edit Special Casing List
  204     --ed-rmwords        Edit Remove Word List
  205     --ed-rmpat      Edit Remove Regexp Patterns List
  206 
  207     --show-log      Dumps namefix.pl's log file to STDOUT
  208 
  209 ";
  210 my $txt_debug =
  211 "Debug Options:
  212 
  213     --debug=N       Set debug level to N (0-10)
  214     --debug-stdout      Print debug log to stdout
  215 
  216 ";
  217 my $txt_mp3 = 
  218 "MP3 Options
  219 
  220     --id3-guess     guess mp3 tags from filename
  221     --id3-overwrite     overwrite existing id3 tags
  222     --id3-rm-v1     remove v1 id3 tags
  223     --id3-rm-v2     remove v2 id3 tags
  224     --id3-art=STRING    Set id3 artist tag to STRING
  225     --id3-tit=STRING    Set id3 title tag to STRING
  226     --id3-tra=STRING    Set id3 track tag to STRING
  227     --id3-alb=STRING    Set id3 album tag to STRING
  228     --id3-yer=STRING    Set id3 year tag to STRING
  229     --id3-com=STRING    Set id3 comment tag to STRING
  230 
  231 ";
  232 
  233 my $msg_help=
  234 $txt_header.
  235 $txt_help;
  236 
  237 my $txt_short=
  238 $txt_header.
  239 $txt_main;
  240 
  241 my $msg_long =
  242 $txt_short.
  243 $txt_misc.
  244 $txt_advance;
  245 
  246 my $msg_all =
  247 $txt_short.
  248 $txt_trunc.
  249 $txt_enum.
  250 $txt_misc.
  251 $txt_advance.
  252 $txt_hacks.
  253 $txt_docs.
  254 $txt_debug.
  255 $txt_mp3;
  256 
  257     if($mode eq "help")
  258     {
  259         print $msg_help;
  260     }
  261     elsif($mode eq "short")
  262     {
  263         print $txt_short;
  264     }
  265     elsif($mode eq "long")
  266     {
  267         print $msg_long;
  268     }
  269     elsif($mode eq "misc")
  270     {
  271         print $txt_misc;
  272     }
  273     elsif($mode eq "adv")
  274     {
  275         print $txt_advance;
  276     }
  277     elsif($mode eq "all")
  278     {
  279         print $msg_all;
  280     }
  281     elsif($mode eq "trunc")
  282     {
  283         print $txt_trunc;
  284     }
  285     elsif($mode eq "enum")
  286     {
  287         print $txt_enum;
  288     }
  289     elsif($mode eq "mp3")
  290     {
  291         print $txt_mp3;
  292     }
  293     elsif($mode eq "doc")
  294     {
  295         print $txt_docs;
  296     }
  297     elsif($mode eq "debug")
  298     {
  299         print $txt_debug;
  300     }
  301     elsif($mode eq "hacks")
  302     {
  303         print $txt_hacks;
  304     }
  305 
  306     else
  307     {
  308         &plog(0, "sub cli_help: help called, but mode \"$mode\" is invalid");
  309     }
  310 
  311     exit 1;
  312 };
  313 
  314 
  315 
  316 1;