Skip to content

Commit 4e96c03

Browse files
committed
prints usage if no directory is passed
1 parent 764ca2f commit 4e96c03

File tree

5 files changed

+28
-7
lines changed

5 files changed

+28
-7
lines changed

History.txt

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
== 1.0 2011-08-11
2+
3+
* Prints usage if no directory is passed.
4+
15
== 0.9 2011-08-11
26

37
* Knows about mobile backups, new in Lion.

README

+4-2
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,11 @@ What's deleted:
4343
* A folder called ".Trashes" in the root directory of volumes stores their
4444
trashes. Those ones are taken into account by the Trash in the Dock.
4545

46-
* Document revisions are stored in the /.DocumentRevisions-V100 folder. (New in Lion.)
46+
* Document revisions are stored on a folder called .DocumentRevisions-V100
47+
in the root directory. (New in Lion.)
4748

48-
* Mobile backups are stored in the /.MobileBackups folder. (New in Lion.)
49+
* Mobile backups are stored on a folder called .MobileBackups in the root
50+
directory. (New in Lion.)
4951

5052
* Some archivers create auxiliary directories called "__MACOSX".
5153

Rakefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,6 @@ Rake::TestTask.new do |t|
77
t.verbose = true
88
end
99

10-
task :home do
11-
sh "scp home/index.html [email protected]:/var/www/gforge-projects/unmac/"
10+
task :readme do
11+
system "ruby -Ilib bin/unmac > README"
1212
end

bin/unmac

+9-3
Original file line numberDiff line numberDiff line change
@@ -51,9 +51,11 @@ What's deleted:
5151
* A folder called "#{Unmacer::TRASHES}" in the root directory of volumes stores their
5252
trashes. Those ones are taken into account by the Trash in the Dock.
5353
54-
* Document revisions are stored in the /.DocumentRevisions-V100 folder. (New in Lion.)
54+
* Document revisions are stored on a folder called #{Unmacer::REVISIONS}
55+
in the root directory. (New in Lion.)
5556
56-
* Mobile backups are stored in the /.MobileBackups folder. (New in Lion.)
57+
* Mobile backups are stored on a folder called #{Unmacer::MBACKUPS} in the root
58+
directory. (New in Lion.)
5759
5860
* Some archivers create auxiliary directories called "#{Unmacer::MACOSX}".
5961
@@ -106,7 +108,11 @@ begin
106108
test = true
107109
end
108110
end
109-
unmacer.unmac!(ARGV) unless test
111+
if ARGV.empty?
112+
usage and exit
113+
else
114+
unmacer.unmac!(ARGV) unless test
115+
end
110116
rescue GetoptLong::InvalidOption
111117
usage and exit 1
112118
end

test/test_unmac.rb

+9
Original file line numberDiff line numberDiff line change
@@ -281,4 +281,13 @@ def test_help
281281
assert_match %r{^Usage\b}, buf
282282
assert ARGV.empty?
283283
end
284+
285+
def test_no_directory
286+
buf = ''
287+
$> = StringIO.open(buf, 'w')
288+
call_unmac
289+
$> = $stdout
290+
assert_match %r{^unmac\b}, buf
291+
assert_match %r{^Usage\b}, buf
292+
end
284293
end

0 commit comments

Comments
 (0)