#!/bin/sh # # This script implements a tool to filter the profiles listed in .listing files # used by the desktop-profiles package. Output format kan be specified using a # format string. # # See desktop-profiles (7) for more information about using profiles through # desktop-profiles and the format of the .listing files # # (c) 2004 Bart Cornelis ############################################################################### print_help () { cat < /dev/null); then PRECEDENCE_FILTER="-$2"; else print_help; exit; fi; ;; -r | --requirement) REQUIREMENT_FILTER="$2" ;; -u | --user) OUR_USER="$2" ;; -s | --sort-key) case $2 in NAME | name | 1) SORT_KEY=1 ;; KIND | kind | 2) SORT_KEY=2 ;; LOCATION | location | 3) SORT_KEY=3 ;; PRECEDENCE| precedence | 4) SORT_KEY=4 SORT_ARGS='--general-numeric-sort --reverse'; ;; REQUIREMENTS | requirements | 5) SORT_KEY=5 ;; DESCRIPTION | description | 6) SORT_KEY=6 ;; *) print_help; exit; ;; esac; ;; -e | --entry-format) FORMAT="$2" ;; *) print_help; exit; ;; esac; # All options take an argument so we should always shift twice # except help, but then we don't get here shift 2; done; # get utility functions for working with .listing files LIB=/usr/share/desktop-profiles/listingmodule; if (test -r $LIB); then . $LIB; else echo "Shell library $LIB is missing! Aborting."; exit 1; fi; # use utility function to give user what he wants (we set up the environment # variables to control the function output in the commandline parsing) filter_listings;