Skip to content
Browse files

Use $PROGRAM_NAME instead of specifying the file name manually.

  • Loading branch information...
1 parent 2d323b0 commit 2cf10e75428c09cd099808fa5c77fe877c3098fa @SaberUK committed Oct 26, 2012
Showing with 5 additions and 5 deletions.
  1. +1 −1 bin/dircount
  2. +1 −1 bin/dupfind
  3. +1 −1 bin/eolstats
  4. +1 −1 bin/renhash
  5. +1 −1 bin/rmjunk
View
2 bin/dircount
@@ -6,7 +6,7 @@
# ==============================================================================
require 'find'
if ARGV.size < 1
- puts 'Syntax: dircount <dir> [all] [rec]'
+ puts "Syntax: #{File.basename($PROGRAM_NAME)} <dir> [all] [rec]"
exit 1
else
dir_count = {}
View
2 bin/dupfind
@@ -7,7 +7,7 @@
require 'digest/sha1'
require 'find'
if ARGV.size < 1
- puts 'Syntax: dupfind <dir> [rm]'
+ puts "Syntax: #{File.basename($PROGRAM_NAME)} <dir> [rm]"
exit 1
else
file_hashes = {}
View
2 bin/eolstats
@@ -5,7 +5,7 @@
# Copyright (C) 2012 Peter "SaberUK" Powell <petpow@saberuk.com>
# ==============================================================================
if ARGV.size < 1
- puts 'Syntax: eolstats <file>'
+ puts "Syntax: #{File.basename($PROGRAM_NAME)} <file>"
exit 1
else
file_contents = File.read(File.expand_path(ARGV[0]))
View
2 bin/renhash
@@ -7,7 +7,7 @@
require 'digest/sha1'
require 'find'
if ARGV.size < 1
- puts 'Syntax: renhash <dir> [sim]'
+ puts "Syntax: #{File.basename($PROGRAM_NAME)} <dir> [sim]"
exit 1
else
Find.find(ARGV[0]).each do |file|
View
2 bin/rmjunk
@@ -7,7 +7,7 @@
require 'fileutils'
require 'find'
if ARGV.size < 1
- puts 'Syntax: rmjunk <dir> [sim]'
+ puts "Syntax: #{File.basename($PROGRAM_NAME)} <dir> [sim]"
exit 1
else
JUNK_ITEMS = [ '._*', '.*_history', '.DS_Store', '.TemporaryItems', 'desktop.ini', 'Thumbs.db' ].freeze

0 comments on commit 2cf10e7

Please sign in to comment.
Something went wrong with that request. Please try again.