Add errors, warnings, and notices options

This commit is contained in:
Gregory John Casamento 2023-07-08 15:39:18 -04:00
parent 83d2840dc5
commit 4e33d19cdf
3 changed files with 72 additions and 0 deletions

View file

@ -119,4 +119,15 @@
* The current Gorm version.
*/
+ (int) currentVersion;
/**
* Current profile for the current model file.
*/
- (NSDictionary *) currentProfile;
/**
* Version information for the model file.
*/
- (NSDictionary *) versionProfiles;
@end

View file

@ -226,6 +226,22 @@ NSString *formatVersion(NSInteger version)
}
/**
* Current profile for the current model file.
*/
- (NSDictionary *) currentProfile;
{
return currentProfile;
}
/**
* Version information for the model file.
*/
- (NSDictionary *) versionProfiles;
{
return versionProfiles;
}
- (BOOL) loadFromFile: (NSString *)path
{
return [self loadFromData: [NSData dataWithContentsOfFile: path]];

View file

@ -141,6 +141,24 @@
parse_val = NO;
}
if ([obj isEqualToString: @"--errors"])
{
[pair setArgument: obj];
parse_val = NO;
}
if ([obj isEqualToString: @"--warnings"])
{
[pair setArgument: obj];
parse_val = NO;
}
if ([obj isEqualToString: @"--notices"])
{
[pair setArgument: obj];
parse_val = NO;
}
// If there is no parameter for the argument, set it anyway...
if (parse_val == NO)
{
@ -271,6 +289,33 @@
NSLog(@"objects = %@", objects);
}
opt = [args objectForKey: @"--errors"];
if (opt != nil)
{
GormFilePrefsManager *mgr = [doc filePrefsManager];
NSDictionary *p = [NSDictionary dictionaryWithDictionary: [mgr currentProfile]];
NSLog(@"errors = %@", p);
}
opt = [args objectForKey: @"--warnings"];
if (opt != nil)
{
GormFilePrefsManager *mgr = [doc filePrefsManager];
NSDictionary *p = [NSDictionary dictionaryWithDictionary: [mgr currentProfile]];
NSLog(@"warnings = %@", p);
}
opt = [args objectForKey: @"--notices"];
if (opt != nil)
{
GormFilePrefsManager *mgr = [doc filePrefsManager];
NSDictionary *p = [NSDictionary dictionaryWithDictionary: [mgr currentProfile]];
NSLog(@"notices = %@", p);
}
// These options sound always be processed last...
opt = [args objectForKey: @"--write"];
if (opt != nil)