-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added -M option to show generated man page
Ticket: ENT-11824 Changelog: None Signed-off-by: Mikita Pilinka <[email protected]>
- Loading branch information
1 parent
3d88acc
commit 15b05a9
Showing
6 changed files
with
208 additions
and
4 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,46 @@ | ||
name: Check-update manual page | ||
on: | ||
push: | ||
branches: [ master ] | ||
paths: | ||
- cfbs/args.py | ||
- setup.py | ||
- cfbs/man_generator.py | ||
jobs: | ||
diff-detecton: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: checkout repo content | ||
uses: actions/checkout@v3 | ||
- name: setup python | ||
uses: actions/setup-python@v4 | ||
with: | ||
python: 3.9 | ||
- name: Install cfbs | ||
run: pip3 install . | ||
- name: Install dependencies | ||
run: pip3 install argparse-manpage | ||
- name: run the manual generator | ||
run: python cfbs/man_generator.py | ||
- name: see if there are any changes | ||
run: | | ||
git diff --exit-code || touch git_diff_exists | ||
if [ -f git_diff_exists ]; then echo "Changes need to be commited"; else echo "No changes to commit"; fi | ||
- name: Commit new manual file | ||
if: hashFiles('git_diff_exists') != '' | ||
run: | | ||
git config user.name 'GitHub' | ||
git config user.email '<[email protected]>' | ||
git add cfbs/cfbs.1 | ||
- name: Create Pull Request | ||
if: hashFiles('git_diff_exists') != '' | ||
uses: cfengine/create-pull-request@v6 | ||
with: | ||
commit-message: 'updates to cfbs manual page' | ||
base: 'master' | ||
title: Manual page updated | ||
body: '' | ||
reviewers: | | ||
olehermanse | ||
nickanderson | ||
branch: updating/manual |
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,97 @@ | ||
.TH CFBS "1" "2024\-06\-07" "cfbs" "CFEngine Build System manual" | ||
.SH NAME | ||
cfbs \- combines multiple modules into 1 policy set to deploy on your infrastructure. Modules can be custom promise types, JSON files which enable certain functionality, or reusable CFEngine policy. The modules you use can be written by the CFEngine team, others in the community, your colleagues, or yourself. | ||
.SH SYNOPSIS | ||
.B cfbs | ||
[-h] [--loglevel LOGLEVEL] [-M] [--version] [--force] [--non-interactive] [--index INDEX] [--check] [--checksum CHECKSUM] [--keep-order] [--git {yes,no}] [--git-user-name GIT_USER_NAME] [--git-user-email GIT_USER_EMAIL] [--git-commit-message GIT_COMMIT_MESSAGE] [--ignore-versions-json] [--masterfiles MASTERFILES] [cmd] [args ...] | ||
.SH DESCRIPTION | ||
CFEngine Build System. | ||
|
||
.TP | ||
\fBcmd\fR | ||
The command to perform (pretty, init, status, search, add, remove, clean, update, validate, download, build, install, help, info, show, input, set\-input, get\-input) | ||
|
||
.TP | ||
\fBargs\fR | ||
Command arguments | ||
|
||
.SH OPTIONS | ||
.TP | ||
\fB\-\-loglevel\fR \fI\,LOGLEVEL\/\fR, \fB\-l\fR \fI\,LOGLEVEL\/\fR | ||
Set log level for more/less detailed output | ||
|
||
.TP | ||
\fB\-M\fR, \fB\-\-manual\fR | ||
Print manual page | ||
|
||
.TP | ||
\fB\-\-version\fR, \fB\-V\fR | ||
Print version number | ||
|
||
.TP | ||
\fB\-\-force\fR | ||
Force rebuild / redownload | ||
|
||
.TP | ||
\fB\-\-non\-interactive\fR | ||
Don't prompt, use defaults (only for testing) | ||
|
||
.TP | ||
\fB\-\-index\fR \fI\,INDEX\/\fR | ||
Specify alternate index | ||
|
||
.TP | ||
\fB\-\-check\fR | ||
Check if file(s) would be reformatted | ||
|
||
.TP | ||
\fB\-\-checksum\fR \fI\,CHECKSUM\/\fR | ||
Expected checksum of the downloaded file | ||
|
||
.TP | ||
\fB\-\-keep\-order\fR | ||
Keep order of items in the JSON in 'cfbs pretty' | ||
|
||
.TP | ||
\fB\-\-git\fR \fI\,{yes,no}\/\fR | ||
Override git option in cfbs.json | ||
|
||
.TP | ||
\fB\-\-git\-user\-name\fR \fI\,GIT_USER_NAME\/\fR | ||
Specify git user name | ||
|
||
.TP | ||
\fB\-\-git\-user\-email\fR \fI\,GIT_USER_EMAIL\/\fR | ||
Specify git user email | ||
|
||
.TP | ||
\fB\-\-git\-commit\-message\fR \fI\,GIT_COMMIT_MESSAGE\/\fR | ||
Specify git commit message | ||
|
||
.TP | ||
\fB\-\-ignore\-versions\-json\fR | ||
Ignore versions.json. Necessary in case of a custom index or testing changes to the default index. | ||
|
||
.TP | ||
\fB\-\-masterfiles\fR \fI\,MASTERFILES\/\fR | ||
Add masterfiles on cfbs init choose between | ||
|
||
.br | ||
Binary packages may be downloaded from https://cfengine.com/download/. | ||
.br | ||
The source code is available at https://github.com/cfengine/ | ||
.SH BUGS | ||
Please see the public bug-tracker at https://northerntech.atlassian.net/projects/CFE/. | ||
.br | ||
GitHub pull-requests may be submitted to https://github.com/cfengine/cfbs. | ||
.SH "SEE ALSO" | ||
.BR cf-promises (8), | ||
.BR cf-agent (8), | ||
.BR cf-serverd (8), | ||
.BR cf-execd (8), | ||
.BR cf-monitord (8), | ||
.BR cf-runagent (8), | ||
.BR cf-key (8) | ||
.SH AUTHOR | ||
Northern.tech AS | ||
|
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,38 @@ | ||
from build_manpages.manpage import Manpage | ||
from args import get_arg_parser | ||
import os | ||
|
||
|
||
def generate_man_page(): | ||
manpage = Manpage(get_arg_parser()) | ||
manpage.manual = "CFEngine Build System manual" | ||
manpage.description = "combines multiple modules into 1 policy set to deploy on your infrastructure. Modules can be custom promise types, JSON files which enable certain functionality, or reusable CFEngine policy. The modules you use can be written by the CFEngine team, others in the community, your colleagues, or yourself." | ||
body = str(manpage) | ||
body = body + ( | ||
""" | ||
.br | ||
Binary packages may be downloaded from https://cfengine.com/download/. | ||
.br | ||
The source code is available at https://github.com/cfengine/ | ||
.SH BUGS | ||
Please see the public bug-tracker at https://northerntech.atlassian.net/projects/CFE/. | ||
.br | ||
GitHub pull-requests may be submitted to https://github.com/cfengine/cfbs. | ||
.SH "SEE ALSO" | ||
.BR cf-promises (8), | ||
.BR cf-agent (8), | ||
.BR cf-serverd (8), | ||
.BR cf-execd (8), | ||
.BR cf-monitord (8), | ||
.BR cf-runagent (8), | ||
.BR cf-key (8) | ||
.SH AUTHOR | ||
Northern.tech AS | ||
""" | ||
) | ||
with open(os.path.dirname(__file__) + "/cfbs.1", "w", encoding="utf-8") as man_file: | ||
man_file.write(body) | ||
return body | ||
|
||
|
||
generate_man_page() |
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