File: zypper-help-all

package info (click to toggle)
zypper 1.14.95-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 28,564 kB
  • sloc: cpp: 27,591; sh: 718; perl: 133; xml: 109; python: 39; makefile: 14
file content (30 lines) | stat: -rwxr-xr-x 763 bytes parent folder | download | duplicates (6)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#! /bin/sh
#
# Prints zypper's main help and help texts of all commands.
#
# The script relies on 'zypper help' commands listed with one tab character at
# the beginning of line and containing only lowercase ascii letters and dashes.
#
# Disclaimer: this script is provided for case someone finds it useful. There
#             is absolutely no warranty that it will do what you expect.

ZYPPER=zypper
GREP=grep
SED=sed

function printline ()
{
  echo "-------------------------------------------------------------------------------"
  echo
}

$ZYPPER -V
echo
$ZYPPER help

COMMANDS=$(LC_ALL=C $ZYPPER | $SED -e '1,/Repository Management:/d' | $GREP -P '^\t\w+' | $SED -e 's/^\t\([a-z-]\+\).*/\1/')
for CMD in $COMMANDS; do
  printline
  $ZYPPER help $CMD;
done