Beispiel #1
0
 def __repr__(self):
     if self.description:
         return_beginning = ", ".join([Colors.LIGHT_GREEN(name) for name in self.names]).ljust(
             20 + 10 * len(self.names))
         return "{}:  {}".format(return_beginning, self.description)
     else:
         return "{}".format(", ".join([Colors.LIGHT_GREEN(name) for name in self.names]))
Beispiel #2
0
# aurman help
aurman_help = Help([])

# usage
usage_title = "Usage"
usage = "aurman <operation> [options] [targets]\n    see also https://www.archlinux.org/pacman/pacman.8.html"
aurman_help.points.append(HelpPoint(usage_title, (usage, )))

# description
description_title = "Description"
description = "aurman is meant as a {}. " \
              "All pacman operations are supported,\n    " \
              "but calling aurman with an operation besides " \
              "{} or {} will {}.".format(Colors.BOLD("pacman wrapper"),
                                         Colors.BOLD(Colors.LIGHT_GREEN("--sync")),
                                         Colors.BOLD(Colors.LIGHT_GREEN("-S")),
                                         Colors.BOLD("just pass the arguments to pacman"))
aurman_help.points.append(HelpPoint(description_title, (description, )))

# native pacman options
native = "the following native pacman options for " \
         "{} or {} will be forwarded to pacman".format(Colors.LIGHT_GREEN("--sync"), Colors.LIGHT_GREEN("-S"))
native_points = []
aurman_help.points.append(HelpPoint(native, native_points))

native_points.append(
    HelpOption([
        "-r", "--root"
    ], "Specify an alternative database location (a typical default is /var/lib/pacman)"
               ))