-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Generate man pages with hidden 'man' command
- Loading branch information
Showing
72 changed files
with
3,559 additions
and
65 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
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
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,39 @@ | ||
//go:build man | ||
// +build man | ||
|
||
package main | ||
|
||
import ( | ||
"fmt" | ||
|
||
"github.com/spf13/cobra" | ||
"github.com/spf13/cobra/doc" | ||
) | ||
|
||
var ( | ||
manCmd = &cobra.Command{ | ||
Use: "man [directory]", | ||
Short: "Generates manpages", | ||
Long: `Generates manpages in the given directory`, | ||
Hidden: true, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
if len(args) != 1 { | ||
return fmt.Errorf("man needs a target directory") | ||
} | ||
return generateManPages(args[0]) | ||
}, | ||
} | ||
) | ||
|
||
func init() { | ||
rootCmd.AddCommand(manCmd) | ||
} | ||
|
||
func generateManPages(targetDirectory string) error { | ||
header := &doc.GenManHeader{ | ||
Section: "1", | ||
Source: "Auto generated by muesli/obs-cli", | ||
} | ||
|
||
return doc.GenManTree(rootCmd, header, targetDirectory) | ||
} |
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,92 @@ | ||
.nh | ||
.TH "OBS-CLI-COMPLETION-BASH" "1" "Dec 2021" "Auto generated by muesli/obs-cli" "" | ||
|
||
.SH NAME | ||
.PP | ||
obs-cli-completion-bash - Generate the autocompletion script for bash | ||
|
||
|
||
.SH SYNOPSIS | ||
.PP | ||
\fBobs-cli completion bash\fP | ||
|
||
|
||
.SH DESCRIPTION | ||
.PP | ||
Generate the autocompletion script for the bash shell. | ||
|
||
.PP | ||
This script depends on the 'bash-completion' package. | ||
If it is not installed already, you can install it via your OS's package manager. | ||
|
||
.PP | ||
To load completions in your current shell session: | ||
|
||
.PP | ||
.RS | ||
|
||
.nf | ||
source <(obs-cli completion bash) | ||
|
||
.fi | ||
.RE | ||
|
||
.PP | ||
To load completions for every new session, execute once: | ||
|
||
.SS Linux: | ||
.PP | ||
.RS | ||
|
||
.nf | ||
obs-cli completion bash > /etc/bash_completion.d/obs-cli | ||
|
||
.fi | ||
.RE | ||
|
||
.SS macOS: | ||
.PP | ||
.RS | ||
|
||
.nf | ||
obs-cli completion bash > /usr/local/etc/bash_completion.d/obs-cli | ||
|
||
.fi | ||
.RE | ||
|
||
.PP | ||
You will need to start a new shell for this setup to take effect. | ||
|
||
|
||
.SH OPTIONS | ||
.PP | ||
\fB-h\fP, \fB--help\fP[=false] | ||
help for bash | ||
|
||
.PP | ||
\fB--no-descriptions\fP[=false] | ||
disable completion descriptions | ||
|
||
|
||
.SH OPTIONS INHERITED FROM PARENT COMMANDS | ||
.PP | ||
\fB--host\fP="localhost" | ||
host to connect to | ||
|
||
.PP | ||
\fB--password\fP="" | ||
password for connection | ||
|
||
.PP | ||
\fB-p\fP, \fB--port\fP=4444 | ||
port to connect to | ||
|
||
|
||
.SH SEE ALSO | ||
.PP | ||
\fBobs-cli-completion(1)\fP | ||
|
||
|
||
.SH HISTORY | ||
.PP | ||
17-Dec-2021 Auto generated by spf13/cobra |
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,77 @@ | ||
.nh | ||
.TH "OBS-CLI-COMPLETION-FISH" "1" "Dec 2021" "Auto generated by muesli/obs-cli" "" | ||
|
||
.SH NAME | ||
.PP | ||
obs-cli-completion-fish - Generate the autocompletion script for fish | ||
|
||
|
||
.SH SYNOPSIS | ||
.PP | ||
\fBobs-cli completion fish [flags]\fP | ||
|
||
|
||
.SH DESCRIPTION | ||
.PP | ||
Generate the autocompletion script for the fish shell. | ||
|
||
.PP | ||
To load completions in your current shell session: | ||
|
||
.PP | ||
.RS | ||
|
||
.nf | ||
obs-cli completion fish | source | ||
|
||
.fi | ||
.RE | ||
|
||
.PP | ||
To load completions for every new session, execute once: | ||
|
||
.PP | ||
.RS | ||
|
||
.nf | ||
obs-cli completion fish > ~/.config/fish/completions/obs-cli.fish | ||
|
||
.fi | ||
.RE | ||
|
||
.PP | ||
You will need to start a new shell for this setup to take effect. | ||
|
||
|
||
.SH OPTIONS | ||
.PP | ||
\fB-h\fP, \fB--help\fP[=false] | ||
help for fish | ||
|
||
.PP | ||
\fB--no-descriptions\fP[=false] | ||
disable completion descriptions | ||
|
||
|
||
.SH OPTIONS INHERITED FROM PARENT COMMANDS | ||
.PP | ||
\fB--host\fP="localhost" | ||
host to connect to | ||
|
||
.PP | ||
\fB--password\fP="" | ||
password for connection | ||
|
||
.PP | ||
\fB-p\fP, \fB--port\fP=4444 | ||
port to connect to | ||
|
||
|
||
.SH SEE ALSO | ||
.PP | ||
\fBobs-cli-completion(1)\fP | ||
|
||
|
||
.SH HISTORY | ||
.PP | ||
17-Dec-2021 Auto generated by spf13/cobra |
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,66 @@ | ||
.nh | ||
.TH "OBS-CLI-COMPLETION-POWERSHELL" "1" "Dec 2021" "Auto generated by muesli/obs-cli" "" | ||
|
||
.SH NAME | ||
.PP | ||
obs-cli-completion-powershell - Generate the autocompletion script for powershell | ||
|
||
|
||
.SH SYNOPSIS | ||
.PP | ||
\fBobs-cli completion powershell [flags]\fP | ||
|
||
|
||
.SH DESCRIPTION | ||
.PP | ||
Generate the autocompletion script for powershell. | ||
|
||
.PP | ||
To load completions in your current shell session: | ||
|
||
.PP | ||
.RS | ||
|
||
.nf | ||
obs-cli completion powershell | Out-String | Invoke-Expression | ||
|
||
.fi | ||
.RE | ||
|
||
.PP | ||
To load completions for every new session, add the output of the above command | ||
to your powershell profile. | ||
|
||
|
||
.SH OPTIONS | ||
.PP | ||
\fB-h\fP, \fB--help\fP[=false] | ||
help for powershell | ||
|
||
.PP | ||
\fB--no-descriptions\fP[=false] | ||
disable completion descriptions | ||
|
||
|
||
.SH OPTIONS INHERITED FROM PARENT COMMANDS | ||
.PP | ||
\fB--host\fP="localhost" | ||
host to connect to | ||
|
||
.PP | ||
\fB--password\fP="" | ||
password for connection | ||
|
||
.PP | ||
\fB-p\fP, \fB--port\fP=4444 | ||
port to connect to | ||
|
||
|
||
.SH SEE ALSO | ||
.PP | ||
\fBobs-cli-completion(1)\fP | ||
|
||
|
||
.SH HISTORY | ||
.PP | ||
17-Dec-2021 Auto generated by spf13/cobra |
Oops, something went wrong.