-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
7 changed files
with
615 additions
and
2 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
Copyright 2021 Hubert Tournier | ||
|
||
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
|
||
1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
|
||
2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. | ||
|
||
3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. | ||
|
||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
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,74 @@ | ||
NAME=about | ||
VERSION=1.0.0 | ||
SOURCES=${NAME}.py | ||
DESTROOTDIR=/usr/local | ||
|
||
# Default action is to show this help message: | ||
.help: | ||
@echo "Possible targets:" | ||
@echo " check-code Verify PEP 8 compliance (lint)" | ||
@echo " check-security Verify security issues (audit)" | ||
@echo " check-unused Find unused code" | ||
@echo " check-version Find required Python version" | ||
@echo " check-sloc Count Single Lines of Code" | ||
@echo " checks Make all the previous tests" | ||
@echo " format Format code" | ||
@echo " tarball Make a tar.gz file for distribution" | ||
@echo " all Build everything" | ||
@echo " install Install under ${DESTROOTDIR}" | ||
@echo " uninstall Uninstall from ${DESTROOTDIR}" | ||
@echo " whatis Rebuild the whatis(1) database" | ||
@echo " clean Remove the compressed man page" | ||
@echo " distclean Remove everything made" | ||
|
||
check-code: /usr/local/bin/pylint | ||
-pylint ${SOURCES} | ||
|
||
lint: check-code | ||
|
||
check-security: /usr/local/bin/bandit | ||
bandit -r ${SOURCES} | ||
|
||
audit: check-security | ||
|
||
check-unused: /usr/local/bin/vulture | ||
vulture --sort-by-size ${SOURCES} | ||
|
||
check-version: /usr/local/bin/vermin | ||
vermin ${SOURCES} | ||
|
||
check-sloc: /usr/local/bin/pygount | ||
pygount --format=summary . | ||
|
||
checks: check-code check-security check-unused check-version check-sloc | ||
|
||
format: /usr/local/bin/black | ||
black ${SOURCES} | ||
|
||
tarball: | ||
tar czf ${NAME}-${VERSION}.tar.gz License Makefile README.md ${NAME}.py ${NAME}.1 | ||
|
||
${NAME}.1.gz: ${NAME}.1 | ||
@gzip -k9 ${NAME}.1 | ||
|
||
all: tarball ${NAME}.1.gz | ||
|
||
install: ${NAME}.1.gz | ||
install -m 0755 -o root -g wheel ${NAME}.py ${DESTROOTDIR}/bin/${NAME} | ||
install -m 0644 -o root -g wheel ${NAME}.1.gz ${DESTROOTDIR}/man/man1 | ||
|
||
uninstall: | ||
rm -f ${DESTROOTDIR}/bin/${NAME} | ||
rm -f ${DESTROOTDIR}/man/man1/${NAME}.1.gz | ||
|
||
whatis: | ||
makewhatis | ||
|
||
love: | ||
@echo "Not war!" | ||
|
||
clean: | ||
@rm -f ${NAME}.1.gz | ||
|
||
distclean: clean | ||
@rm -f ${NAME}-${VERSION}.tar.gz |
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,62 @@ | ||
# ABOUT(1) | ||
|
||
## NAME | ||
about - show system information | ||
|
||
## SYNOPSIS | ||
**about** | ||
[-a\|--all] | ||
[-S\|--sys\|--system] | ||
[-H\|--hw\|--hardware] | ||
[-O\|--os\|--operating] | ||
[-E\|--env\|--environment] | ||
[-P\|--py\|--python] | ||
[-d\|--debug] | ||
[-h\|--help\|-?] | ||
[-v\|--version] | ||
[--] | ||
|
||
## DESCRIPTION | ||
The **about** utility shows most of the system information available through the [Python Standard Library](https://docs.python.org/3/library/index.html). | ||
|
||
## OPTIONS | ||
|
||
Options | Use | ||
------- | --- | ||
-a\|--all|Same as -SHOEP. | ||
-S\|--sys\|--system|Show information about the system. | ||
-H\|--hw\|--hardware|Show information about the hardware. | ||
-O\|--os\|--operating|Show information about the Operating System. | ||
-E\|--env\|--environment|Show information about the environment. | ||
-P\|--py\|--python|Show information about Python. | ||
-d\|--debug|Enable debug level messages. | ||
-h\|--help\|-?|Print usage and a short help message and exit. | ||
-v\|--version|Print version and exit. | ||
--|Options processing terminator. | ||
|
||
## EXIT STATUS | ||
The about utility exits 0 on success, and >0 if an error occurs. | ||
|
||
## SEE ALSO | ||
[uname(1)](https://www.freebsd.org/cgi/man.cgi?query=uname), [sysctl(8)](https://www.freebsd.org/cgi/man.cgi?query=sysctl) | ||
|
||
https://docs.python.org/3/library/index.html | ||
|
||
## STANDARDS | ||
The about command is not a standard [UNIX](https://en.wikipedia.org/wiki/Unix)/[POSIX](https://en.wikipedia.org/wiki/POSIX) command. | ||
|
||
It tries to follow the [PEP 8](https://www.python.org/dev/peps/pep-0008/) style guide for [Python](https://www.python.org/) code. | ||
We check this with the [Pylint](https://www.pylint.org/) command. | ||
|
||
## PORTABILITY | ||
Tested OK under Windows. | ||
|
||
## HISTORY | ||
The about command was created as an example for the [PNU project](https://github.com/HubTou/PNU), testing many of the [standard Python functions](https://docs.python.org/3/library/index.html) for getting system information. | ||
|
||
## LICENSE | ||
This utility is available under the [3-clause BSD license](https://opensource.org/licenses/BSD-3-Clause). | ||
|
||
## AUTHOR | ||
[Hubert Tournier](https://github.com/HubTou) | ||
|
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,69 @@ | ||
.TH ABOUT 1 | ||
.SH NAME | ||
about \- show system information | ||
.SH SYNOPSIS | ||
.B about | ||
[\-a|\-\-all] | ||
[\-S|\-\-sys|\-\-system] | ||
[\-H|\-\-hw|\-\-hardware] | ||
[\-O|\-\-os|\-\-operating] | ||
[\-E|\-\-env|\-\-environment] | ||
[\-P|\-\-py|\-\-python] | ||
[\-d|\-\-debug] | ||
[\-h|\-\-help|\-?] | ||
[\-v|\-\-version] | ||
[\-\-] | ||
.SH DESCRIPTION | ||
The | ||
.B about | ||
utility shows most of the system information available through the Python Standard Library. | ||
.SH OPTIONS | ||
.TP | ||
.BR \-a|\-\-all | ||
Same as -SHOEP. | ||
.TP | ||
.BR \-S|\-\-sys|\-\-system | ||
Show information about the system. | ||
.TP | ||
.BR \-H|\-\-hw|\-\-hardware | ||
Show information about the hardware. | ||
.TP | ||
.BR \-O|\-\-os|\-\-operating | ||
Show information about the Operating System. | ||
.TP | ||
.BR \-E|\-\-env|\-\-environment | ||
Show information about the environment. | ||
.TP | ||
.BR \-P|\-\-py|\-\-python | ||
Show information about Python. | ||
.TP | ||
.BR \-d|\-\-debug | ||
Enable debug level messages. | ||
.TP | ||
.BR \-h|\-\-help|\-? | ||
Print usage and a short help message and exit. | ||
.TP | ||
.BR \-v|\-\-version | ||
Print version and exit. | ||
.TP | ||
.BR \-\- | ||
Options processing terminator. | ||
.SH EXIT STATUS | ||
The about utility exits 0 on success, and >0 if an error occurs. | ||
.SH SEE ALSO | ||
uname(1), sysctl(8) | ||
.PP | ||
https://docs.python.org/3/library/index.html | ||
.SH STANDARDS | ||
The about command is not a standard UNIX/POSIX command. | ||
.PP | ||
It tries to follow the PEP 8 style guide for Python code (see https://www.python.org/dev/peps/pep-0008/). | ||
We check this with the Pylint command (see https://www.pylint.org/). | ||
.SH PORTABILITY | ||
Tested OK under Windows. | ||
.SH HISTORY | ||
The about command was created as an example for the PNU project, testing many of the standard Python functions for getting system information. | ||
.SH LICENSE | ||
This utility is available under the 3-clause BSD license (see https://opensource.org/licenses/BSD-3-Clause). | ||
.SH AUTHOR | ||
Hubert Tournier |
Oops, something went wrong.