Skip to content

Commit

Permalink
utils, help: Show basic help when "man" command is not available. Fixes
Browse files Browse the repository at this point in the history
containers#713

Fedora CoreOS systems do not have the man command installed. Running
toolbox --help on such a system results in a "man(1) not found" error.

As a compromise for systems without man, we added a simple help text
showing the most commonly used toolbox commands and an URL that direct
users to the Toolbox website where they can find the manuals in Markdown
format.
  • Loading branch information
olivergs committed Jul 13, 2021
1 parent d03a5fe commit 10489ba
Showing 1 changed file with 12 additions and 1 deletion.
13 changes: 12 additions & 1 deletion src/pkg/utils/utils.go
Original file line number Diff line number Diff line change
Expand Up @@ -731,7 +731,18 @@ func ShowManual(manual string) error {
manBinary, err := exec.LookPath("man")
if err != nil {
if errors.Is(err, exec.ErrNotFound) {
return errors.New("man(1) not found")
fmt.Print(`
toolbox - Tool for containerized command line environments on Linux
Common commands are:
create Create a new toolbox container
enter Enter an existing toolbox container
list List all existing toolbox containers and images
Go to https://github.com/containers/toolbox for further information.
`)
return nil
}

return errors.New("failed to lookup man(1)")
Expand Down

0 comments on commit 10489ba

Please sign in to comment.