summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2011-12-14 12:37:45 +0100
committerVincent Untz <vuntz@gnome.org>2011-12-14 12:38:36 +0100
commitaa770a3b41d14c0ac27fed18dd7024de9e5b8d77 (patch)
treed5b8cfda68a69ecd1d6e0de213b6552fa0a4119a
parente09e297506ce5c84b2ad7924ac94391a2437ed61 (diff)
downloaddesktop-file-utils-aa770a3b41d14c0ac27fed18dd7024de9e5b8d77.tar.gz
install: Add --add-not-show-in/--remove-not-show-in options
-rw-r--r--src/install.c30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/install.c b/src/install.c
index bca4b09..a4228dd 100644
--- a/src/install.c
+++ b/src/install.c
@@ -444,6 +444,26 @@ static const GOptionEntry edit_options[] = {
N_("ENVIRONMENT")
},
{
+#define OPTION_ADD_NOT_SHOW_IN "add-not-show-in"
+ OPTION_ADD_NOT_SHOW_IN,
+ '\0',
+ '\0',
+ G_OPTION_ARG_CALLBACK,
+ parse_edit_options_callback,
+ N_("Add ENVIRONMENT to the list of desktop environment where the desktop files should not be displayed"),
+ N_("ENVIRONMENT")
+ },
+ {
+#define OPTION_REMOVE_NOT_SHOW_IN "remove-not-show-in"
+ OPTION_REMOVE_NOT_SHOW_IN,
+ '\0',
+ '\0',
+ G_OPTION_ARG_CALLBACK,
+ parse_edit_options_callback,
+ N_("Remove ENVIRONMENT from the list of desktop environment where the desktop files should not be displayed"),
+ N_("ENVIRONMENT")
+ },
+ {
NULL
}
};
@@ -591,6 +611,16 @@ parse_edit_options_callback (const gchar *option_name,
PARSE_OPTION_LIST (DFU_REMOVE_FROM_LIST, "OnlyShowIn");
}
+ else if (strcmp (OPTION_ADD_NOT_SHOW_IN, option_name) == 0)
+ {
+ PARSE_OPTION_LIST (DFU_ADD_TO_LIST, "NotShowIn");
+ }
+
+ else if (strcmp (OPTION_REMOVE_NOT_SHOW_IN, option_name) == 0)
+ {
+ PARSE_OPTION_LIST (DFU_REMOVE_FROM_LIST, "NotShowIn");
+ }
+
else
{
g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED,