summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Bingner <sam@bingner.com>2021-02-19 00:55:33 -1000
committerSam Bingner <sam@bingner.com>2021-02-19 23:16:36 -1000
commitb89c8cbe13cd6fd0a12871487e53f39b5a85ed3b (patch)
tree10d15d307358350bf887da9f52222074addcdd8e
parent66e7e9bf29052d784fb71c65589574d5fd15b3b6 (diff)
Add force optionv1.1.20
-rw-r--r--uicache.mm10
1 files changed, 8 insertions, 2 deletions
diff --git a/uicache.mm b/uicache.mm
index cfeb69c..28ea420 100644
--- a/uicache.mm
+++ b/uicache.mm
@@ -172,7 +172,8 @@ static int standard_uicache(void);
static Class $MCMPluginKitPluginDataContainer;
static Class $MCMAppDataContainer;
static Class $LSApplicationWorkspace;
-LSApplicationWorkspace *workspace=nil;
+LSApplicationWorkspace *workspace;
+static bool force;
int list_all_apps(void)
{
@@ -202,6 +203,7 @@ int list_app(NSString *appid) {
NSString *getAppPath(NSString *path)
{
+ if (force) return path;
path = [path stringByResolvingSymlinksInPath];
if (![path hasPrefix:@"/Applications/"]) {
fprintf(stderr, "Error: Path must be within /Applications/\n");
@@ -212,6 +214,7 @@ NSString *getAppPath(NSString *path)
bool appIsRegistered(NSString *path)
{
+ if (force) return true;
@autoreleasepool {
path = getAppPath(path);
if (!path) return false;
@@ -680,12 +683,15 @@ int main(int argc, const char *argv[])
NSString *app_id = NULL;
char ch;
bool have_path = false;
- while ((ch = getopt_long(argc, (char *const *)argv, "al::p:ru:vh?", long_options, &option_index)) != -1) {
+ while ((ch = getopt_long(argc, (char *const *)argv, "afl::p:ru:vh?", long_options, &option_index)) != -1) {
switch (ch)
{
case 'a':
do_all = true;
break;
+ case 'f':
+ force = true;
+ break;
case 'h':
usage();
break;