-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathfa.m
More file actions
50 lines (40 loc) · 801 Bytes
/
fa.m
File metadata and controls
50 lines (40 loc) · 801 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
/*
* fa.m
* qfu
*
* Created by Benjamin Fortin on 7/4/10.
* Copyright 2010 Benjamin Fortin. All rights reserved.
*
*/
#import "fa.h"
int main(int argc, const char *argv[])
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
//NSLog(@"* %s * %s", __DATE__, __TIME__);
if(argc == 1)
{
//no arguments
showUsage();
return 0;
}
QFUSizeUnit requestedUnit = QFUSizeUnitNoUnit;
NSArray *files = nil;
if(!strcmp(argv[1], "-u"))
{
if(argc < 4)
{
showUsage();
return 0;
}
requestedUnit = sizeUnitFromString(argv[2]);
files = arrayWithFilenames(argv, NSMakeRange(3, argc));
}
else
{
files = arrayWithFilenames(argv, NSMakeRange(1, argc));
}
for(NSString *file in files)
printf("%s\n", [file UTF8String]);
[pool drain];
return 0;
}