-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add:
pontos
command that lists pontos features [#267]
Add: `pontos` command that lists pontos features
- Loading branch information
Showing
6 changed files
with
205 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2021-2022 Greenbone Networks GmbH | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from .pontos import main | ||
|
||
__all__ = ["main"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2021-2022 Greenbone Networks GmbH | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
from pontos.terminal.terminal import Terminal | ||
|
||
|
||
def main() -> None: | ||
term = Terminal() | ||
|
||
term.print() | ||
term.bold_info('pontos - Greenbone Python Utilities and Tools') | ||
term.print() | ||
term.print('The following commands are currently available:') | ||
with term.indent(): | ||
term.bold_info( | ||
'pontos-release - Release handling ' | ||
'utility for C and Python Projects' | ||
) | ||
term.print('usage:') | ||
with term.indent(): | ||
term.print('pontos-release {prepare,release,sign} -h') | ||
term.bold_info( | ||
'pontos-version - Version handling utility ' | ||
'for C, Go and Python Projects' | ||
) | ||
term.print('usage:') | ||
with term.indent(): | ||
term.print('pontos-version {verify,show,update} -h') | ||
term.bold_info( | ||
'pontos-update-header - Handling Copyright header ' | ||
'for various file types and licences' | ||
) | ||
term.print('usage:') | ||
with term.indent(): | ||
term.print('pontos-update-header -h') | ||
term.bold_info( | ||
'pontos-changelog - Parse conventional commits in the ' | ||
'current branch, creating CHANGELOG.md file' | ||
) | ||
term.print('usage:') | ||
with term.indent(): | ||
term.print('pontos-changelog -h') | ||
term.bold_info( | ||
'pontos-github - Handling GitHub operations, like ' | ||
'Pull Requests (beta)' | ||
) | ||
term.print('usage:') | ||
with term.indent(): | ||
term.print('pontos-github {pr} -h') | ||
term.print() | ||
term.info( | ||
'pontos also comes with a Terminal interface ' | ||
'printing prettier outputs' | ||
) | ||
with term.indent(): | ||
term.print('Accessable with import "pontos.terminal"') | ||
term.info('pontos also comes with git and GitHub APIs') | ||
with term.indent(): | ||
term.print( | ||
'Accessable with "import pontos.git" ' | ||
'and "import pontos.github"' | ||
) | ||
|
||
term.print() | ||
term.warning( | ||
'Use the listed commands "help" for more information ' | ||
'and arguments description.' | ||
) | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
# -*- coding: utf-8 -*- | ||
# Copyright (C) 2022 Greenbone Networks GmbH | ||
# | ||
# SPDX-License-Identifier: GPL-3.0-or-later | ||
# | ||
# This program is free software: you can redistribute it and/or modify | ||
# it under the terms of the GNU General Public License as published by | ||
# the Free Software Foundation, either version 3 of the License, or | ||
# (at your option) any later version. | ||
# | ||
# This program is distributed in the hope that it will be useful, | ||
# but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
# GNU General Public License for more details. | ||
# | ||
# You should have received a copy of the GNU General Public License | ||
# along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
|
||
import unittest | ||
from unittest.mock import patch | ||
|
||
from pontos import main | ||
|
||
|
||
class TestPontos(unittest.TestCase): | ||
@patch("pontos.pontos.Terminal") | ||
def test_pontos(self, terminal_mock): | ||
main() | ||
|
||
terminal_mock.return_value.print.assert_called() | ||
terminal_mock.return_value.indent.assert_called() | ||
terminal_mock.return_value.bold_info.assert_called() | ||
terminal_mock.return_value.info.assert_called() | ||
terminal_mock.return_value.warning.assert_called_once_with( | ||
'Use the listed commands "help" for more information ' | ||
'and arguments description.' | ||
) |