summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVincent Untz <vuntz@gnome.org>2011-12-14 14:07:50 +0100
committerVincent Untz <vuntz@gnome.org>2011-12-14 14:08:38 +0100
commit921e85969dc4fe20246b59887b093da838ca3f5a (patch)
treedb82ff4ecfd9b45b8012c3766999f2b08b9e7ce8
parenta64187fc8a82bc8dda824bdf5046e6455377425a (diff)
install: Move options around
The new order in --help-edit makes more sense.
-rw-r--r--src/install.c72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/install.c b/src/install.c
index ebd0fe2..fce2bc2 100644
--- a/src/install.c
+++ b/src/install.c
@@ -359,14 +359,14 @@ static const GOptionEntry options[] = {
static const GOptionEntry edit_options[] = {
{
-#define OPTION_COPY_NAME "copy-name-to-generic-name"
- OPTION_COPY_NAME,
+#define OPTION_SET_NAME "set-name"
+ OPTION_SET_NAME,
+ '\0',
'\0',
- G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK,
parse_edit_options_callback,
- N_("Copy the value of the \"Name\" key to the \"GenericName\" key"),
- NULL
+ N_("Set the \"Name\" key to NAME"),
+ N_("NAME")
},
{
#define OPTION_COPY_GENERIC_NAME "copy-generic-name-to-name"
@@ -379,24 +379,24 @@ static const GOptionEntry edit_options[] = {
NULL
},
{
-#define OPTION_SET_NAME "set-name"
- OPTION_SET_NAME,
+#define OPTION_SET_GENERIC_NAME "set-generic-name"
+ OPTION_SET_GENERIC_NAME,
'\0',
'\0',
G_OPTION_ARG_CALLBACK,
parse_edit_options_callback,
- N_("Set the \"Name\" key to NAME"),
- N_("NAME")
+ N_("Set the \"GenericName\" key to GENERIC-NAME"),
+ N_("GENERIC-NAME")
},
{
-#define OPTION_SET_GENERIC_NAME "set-generic-name"
- OPTION_SET_GENERIC_NAME,
- '\0',
+#define OPTION_COPY_NAME "copy-name-to-generic-name"
+ OPTION_COPY_NAME,
'\0',
+ G_OPTION_FLAG_NO_ARG,
G_OPTION_ARG_CALLBACK,
parse_edit_options_callback,
- N_("Set the \"GenericName\" key to GENERIC-NAME"),
- N_("GENERIC-NAME")
+ N_("Copy the value of the \"Name\" key to the \"GenericName\" key"),
+ NULL
},
{
#define OPTION_SET_COMMENT "set-comment"
@@ -419,16 +419,6 @@ static const GOptionEntry edit_options[] = {
N_("ICON")
},
{
-#define OPTION_REMOVE_KEY "remove-key"
- OPTION_REMOVE_KEY,
- '\0',
- '\0',
- G_OPTION_ARG_CALLBACK,
- parse_edit_options_callback,
- N_("Remove the KEY key from the desktop files, if present"),
- N_("KEY")
- },
- {
#define OPTION_ADD_CATEGORY "add-category"
OPTION_ADD_CATEGORY,
'\0',
@@ -509,6 +499,16 @@ static const GOptionEntry edit_options[] = {
N_("ENVIRONMENT")
},
{
+#define OPTION_REMOVE_KEY "remove-key"
+ OPTION_REMOVE_KEY,
+ '\0',
+ '\0',
+ G_OPTION_ARG_CALLBACK,
+ parse_edit_options_callback,
+ N_("Remove the KEY key from the desktop files, if present"),
+ N_("KEY")
+ },
+ {
NULL
}
};
@@ -608,9 +608,9 @@ parse_edit_options_callback (const gchar *option_name,
} \
} while (0)
- if (strcmp (OPTION_COPY_NAME, option_name) == 0)
+ if (strcmp (OPTION_SET_NAME, option_name) == 0)
{
- action = dfu_edit_action_new (DFU_COPY_KEY, "Name", "GenericName");
+ action = dfu_edit_action_new (DFU_SET_KEY, "Name", value);
edit_actions = g_slist_prepend (edit_actions, action);
}
@@ -620,15 +620,15 @@ parse_edit_options_callback (const gchar *option_name,
edit_actions = g_slist_prepend (edit_actions, action);
}
- else if (strcmp (OPTION_SET_NAME, option_name) == 0)
+ else if (strcmp (OPTION_SET_GENERIC_NAME, option_name) == 0)
{
- action = dfu_edit_action_new (DFU_SET_KEY, "Name", value);
+ action = dfu_edit_action_new (DFU_SET_KEY, "GenericName", value);
edit_actions = g_slist_prepend (edit_actions, action);
}
- else if (strcmp (OPTION_SET_GENERIC_NAME, option_name) == 0)
+ else if (strcmp (OPTION_COPY_NAME, option_name) == 0)
{
- action = dfu_edit_action_new (DFU_SET_KEY, "GenericName", value);
+ action = dfu_edit_action_new (DFU_COPY_KEY, "Name", "GenericName");
edit_actions = g_slist_prepend (edit_actions, action);
}
@@ -644,12 +644,6 @@ parse_edit_options_callback (const gchar *option_name,
edit_actions = g_slist_prepend (edit_actions, action);
}
- else if (strcmp (OPTION_REMOVE_KEY, option_name) == 0)
- {
- action = dfu_edit_action_new (DFU_REMOVE_KEY, value, NULL);
- edit_actions = g_slist_prepend (edit_actions, action);
- }
-
else if (strcmp (OPTION_ADD_CATEGORY, option_name) == 0)
{
PARSE_OPTION_LIST (DFU_ADD_TO_LIST, "Categories");
@@ -690,6 +684,12 @@ parse_edit_options_callback (const gchar *option_name,
PARSE_OPTION_LIST (DFU_REMOVE_FROM_LIST, "NotShowIn");
}
+ else if (strcmp (OPTION_REMOVE_KEY, option_name) == 0)
+ {
+ action = dfu_edit_action_new (DFU_REMOVE_KEY, value, NULL);
+ edit_actions = g_slist_prepend (edit_actions, action);
+ }
+
else
{
g_set_error (error, G_OPTION_ERROR, G_OPTION_ERROR_FAILED,