diff options
author | David Zeuthen <davidz@redhat.com> | 2009-09-11 11:35:58 -0400 |
---|---|---|
committer | David Zeuthen <davidz@redhat.com> | 2009-09-11 11:35:58 -0400 |
commit | f8f132f066a930e296aa327d4c35c6d644774b9c (patch) | |
tree | 7762ab612a84769db63f3c6c3f60f55f95844007 | |
parent | c7ded649ab294d8960ebf3be98461f509c10bdf1 (diff) |
Sort by action id in pkaction(1) output
-rw-r--r-- | src/programs/pkaction.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/programs/pkaction.c b/src/programs/pkaction.c index 3493bc0..7d8f645 100644 --- a/src/programs/pkaction.c +++ b/src/programs/pkaction.c @@ -93,6 +93,14 @@ print_action (PolkitActionDescription *action, } } +static gint +action_desc_compare_by_action_id_func (PolkitActionDescription *a, + PolkitActionDescription *b) +{ + return g_strcmp0 (polkit_action_description_get_action_id (a), + polkit_action_description_get_action_id (b)); +} + int main (int argc, char *argv[]) { @@ -196,6 +204,9 @@ main (int argc, char *argv[]) } else { + actions = g_list_sort (actions, + (GCompareFunc) action_desc_compare_by_action_id_func); + for (l = actions; l != NULL; l = l->next) { PolkitActionDescription *action = POLKIT_ACTION_DESCRIPTION (l->data); |