kiwi.help

 1# Copyright (c) 2015 SUSE Linux GmbH.  All rights reserved.
 2#
 3# This file is part of kiwi.
 4#
 5# kiwi is free software: you can redistribute it and/or modify
 6# it under the terms of the GNU General Public License as published by
 7# the Free Software Foundation, either version 3 of the License, or
 8# (at your option) any later version.
 9#
10# kiwi is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with kiwi.  If not, see <http://www.gnu.org/licenses/>
17#
18import subprocess
19
20# project
21from .exceptions import KiwiHelpNoCommandGiven
22
23
24class Help:
25    """
26    **Implements man page help for kiwi commands**
27
28    Each kiwi command implements their own manual page, which is
29    shown if the positional argument 'help' is passed to the
30    command.
31    """
32    def show(self, command=None):
33        """
34        Call man to show the command specific manual page
35
36        All kiwi commands store their manual page in the section '8'
37        of the man system. The calling process is replaced by the
38        man process
39
40        :param string command: man page name
41        """
42        if not command:
43            raise KiwiHelpNoCommandGiven("No help context specified")
44        subprocess.call('man 8 ' + command, shell=True)
class Help:
25class Help:
26    """
27    **Implements man page help for kiwi commands**
28
29    Each kiwi command implements their own manual page, which is
30    shown if the positional argument 'help' is passed to the
31    command.
32    """
33    def show(self, command=None):
34        """
35        Call man to show the command specific manual page
36
37        All kiwi commands store their manual page in the section '8'
38        of the man system. The calling process is replaced by the
39        man process
40
41        :param string command: man page name
42        """
43        if not command:
44            raise KiwiHelpNoCommandGiven("No help context specified")
45        subprocess.call('man 8 ' + command, shell=True)

Implements man page help for kiwi commands

Each kiwi command implements their own manual page, which is shown if the positional argument 'help' is passed to the command.

def show(self, command=None):
33    def show(self, command=None):
34        """
35        Call man to show the command specific manual page
36
37        All kiwi commands store their manual page in the section '8'
38        of the man system. The calling process is replaced by the
39        man process
40
41        :param string command: man page name
42        """
43        if not command:
44            raise KiwiHelpNoCommandGiven("No help context specified")
45        subprocess.call('man 8 ' + command, shell=True)

Call man to show the command specific manual page

All kiwi commands store their manual page in the section '8' of the man system. The calling process is replaced by the man process

Parameters
  • string command: man page name