Skip to content

Commit

Permalink
chore: refer to man pages
Browse files Browse the repository at this point in the history
  • Loading branch information
geyslan committed Dec 7, 2023
1 parent 75908ae commit d63110a
Show file tree
Hide file tree
Showing 7 changed files with 20 additions and 52 deletions.
8 changes: 3 additions & 5 deletions docs/docs/advanced/caching-events.md
Expand Up @@ -3,11 +3,9 @@
Tracee has an events caching (in-memory) mechanism. In order to check latest
caching options you may execute:

<!-- TODO: build man page -->
<!-- ```console
man tracee-cache
``` -->

```console
./dist/tracee man cache
```

<!-- TODO: reference the architecture page again-->

Expand Down
9 changes: 3 additions & 6 deletions docs/docs/advanced/dropping-capabilities.md
Expand Up @@ -49,12 +49,9 @@ does is through different "execution protection rings":

You may see all available capabilities in the running environment by running:

<!-- TODO: build man page -->
<!-- ```console
man tracee-capabilities
``` -->

command line flag.
```console
capsh --print
```

## Bypass capabilities dropping feature

Expand Down
9 changes: 3 additions & 6 deletions docs/docs/advanced/forensics.md
Expand Up @@ -3,12 +3,9 @@
Tracee has a unique feature that lets you capture interesting artifacts from
running applications, using the `--capture` flag.



<!-- TODO: build man page -->
<!-- ```console
man tracee-capture
``` -->
```console
./dist/tracee man capture
```

```console
sudo ./dist/tracee --capture xxx
Expand Down
4 changes: 1 addition & 3 deletions pkg/cmd/flags/capture.go
Expand Up @@ -190,9 +190,7 @@ func PrepareCapture(captureSlice []string, newBinary bool) (config.CaptureConfig
}
} else {
if newBinary {
// TODO: build man page
// return config.CaptureConfig{}, errfmt.Errorf("invalid capture option specified, see 'tracee-capture' man page for more info")
return config.CaptureConfig{}, errfmt.Errorf("invalid capture option specified, use '--help' for more info")
return config.CaptureConfig{}, errfmt.Errorf("invalid capture option specified, run 'man capture' for more info")
}

return config.CaptureConfig{}, errfmt.Errorf("invalid capture option specified, use '--capture help' for more info")
Expand Down
4 changes: 1 addition & 3 deletions pkg/cmd/flags/errors.go
Expand Up @@ -14,9 +14,7 @@ func InvalidEventExcludeError(event string) error {

func InvalidScopeOptionError(expr string, newBinary bool) error {
if newBinary {
// TODO: build man page
// return fmt.Errorf("invalid scope option specified (%s), see 'tracee-scope' man page for more info", expr)
return fmt.Errorf("invalid scope option specified (%s), use '--help' for more info", expr)
return fmt.Errorf("invalid scope option specified (%s), run 'man scope' for more info", expr)
}

return fmt.Errorf("invalid scope option specified (%s), use '--scope help' for more info", expr)
Expand Down
6 changes: 1 addition & 5 deletions pkg/cmd/flags/logger.go
Expand Up @@ -50,9 +50,7 @@ func invalidLogOption(err error, opt string, newBinary bool) error {
}

if newBinary {
// TODO: build man page
// return errfmt.Errorf("invalid log option: %s, %s, see 'tracee-log' man page for more info", opt, err)
return errfmt.Errorf("invalid log option: %s, %s, use '--help' for more info", opt, err)
return errfmt.Errorf("invalid log option: %s, %s, run 'man log' for more info", opt, err)
}

return errfmt.Errorf("invalid log option: %s, %s, use '--log help' for more info", opt, err)
Expand All @@ -65,8 +63,6 @@ func invalidLogOptionValue(err error, opt string, newBinary bool) error {
}

if newBinary {
// TODO: build man page
// return errfmt.Errorf("invalid log option value: %s, %s, see 'tracee-log' man page for more info", opt, err)
return errfmt.Errorf("invalid log option value: %s, %s, use '--help' for more info", opt, err)
}

Expand Down
32 changes: 8 additions & 24 deletions pkg/cmd/flags/output.go
Expand Up @@ -39,9 +39,7 @@ func PrepareOutput(outputSlice []string, newBinary bool) (PrepareOutputResult, e
case "none":
if len(outputParts) > 1 {
if newBinary {
// TODO: build man page
// return outConfig, errors.New("none output does not support path. See 'tracee-output' man page for more info")
return outConfig, errors.New("none output does not support path. Use '--help' for more info")
return outConfig, errors.New("none output does not support path. Run 'man output' for more info")
}

return outConfig, errors.New("none output does not support path. Use '--output help' for more info")
Expand Down Expand Up @@ -73,9 +71,7 @@ func PrepareOutput(outputSlice []string, newBinary bool) (PrepareOutputResult, e
}
default:
if newBinary {
// TODO: build man page
// return outConfig, fmt.Errorf("invalid output flag: %s, see 'tracee-output' man page for more info", outputParts[0])
return outConfig, fmt.Errorf("invalid output flag: %s, use '--help' for more info", outputParts[0])
return outConfig, fmt.Errorf("invalid output flag: %s, run 'man output' for more info", outputParts[0])
}

return outConfig, fmt.Errorf("invalid output flag: %s, use '--output help' for more info", outputParts[0])
Expand Down Expand Up @@ -118,9 +114,7 @@ func setOption(cfg *config.OutputConfig, option string, newBinary bool) error {
cfg.EventsSorting = true
default:
if newBinary {
// TODO: build man page
// return errfmt.Errorf("invalid output option: %s, see 'tracee-output' man page for more info", option)
return errfmt.Errorf("invalid output option: %s, use '--help' for more info", option)
return errfmt.Errorf("invalid output option: %s, run 'man output' for more info", option)
}

return errfmt.Errorf("invalid output option: %s, use '--output help' for more info", option)
Expand Down Expand Up @@ -171,19 +165,15 @@ func parseFormat(outputParts []string, printerMap map[string]string, newBinary b
for _, outPath := range strings.Split(outputParts[1], ",") {
if outPath == "" {
if newBinary {
// TODO: build man page
// return errfmt.Errorf("format flag can't be empty, see 'tracee-output' man page for more info")
return errfmt.Errorf("format flag can't be empty, use '--help' for more info")
return errfmt.Errorf("format flag can't be empty, run 'man output' for more info")
}

return errfmt.Errorf("format flag can't be empty, use '--output help' for more info")
}

if _, ok := printerMap[outPath]; ok {
if newBinary {
// TODO: build man page
// return errfmt.Errorf("cannot use the same path for multiple outputs: %s, see 'tracee-output' man page for more info", outPath)
return errfmt.Errorf("cannot use the same path for multiple outputs: %s, use '--help' for more info", outPath)
return errfmt.Errorf("cannot use the same path for multiple outputs: %s, run 'man output' for more info", outPath)
}

return errfmt.Errorf("cannot use the same path for multiple outputs: %s, use '--output help' for more info", outPath)
Expand All @@ -198,9 +188,7 @@ func parseFormat(outputParts []string, printerMap map[string]string, newBinary b
func parseOption(outputParts []string, traceeConfig *config.OutputConfig, newBinary bool) error {
if len(outputParts) == 1 || outputParts[1] == "" {
if newBinary {
// TODO: build man page
// return errfmt.Errorf("option flag can't be empty, see 'tracee-output' man page for more info")
return errfmt.Errorf("option flag can't be empty, use '--help' for more info")
return errfmt.Errorf("option flag can't be empty, run 'man output' for more info")
}

return errfmt.Errorf("option flag can't be empty, use '--output help' for more info")
Expand Down Expand Up @@ -240,9 +228,7 @@ func createFile(path string) (*os.File, error) {
func validateURL(outputParts []string, flag string, newBinary bool) error {
if len(outputParts) == 1 || outputParts[1] == "" {
if newBinary {
// TODO: build man page
// return errfmt.Errorf("%s flag can't be empty, see 'tracee-output' man page for more info", flag)
return errfmt.Errorf("%s flag can't be empty, use '--help' for more info", flag)
return errfmt.Errorf("%s flag can't be empty, run 'man output' for more info", flag)
}

return errfmt.Errorf("%s flag can't be empty, use '--output help' for more info", flag)
Expand All @@ -252,9 +238,7 @@ func validateURL(outputParts []string, flag string, newBinary bool) error {

if err != nil {
if newBinary {
// TODO: build man page
// return errfmt.Errorf("invalid uri for %s output %q. Use 'tracee-output' man page for more info", flag, outputParts[1])
return errfmt.Errorf("invalid uri for %s output %q. Use '--help' for more info", flag, outputParts[1])
return errfmt.Errorf("invalid uri for %s output %q. Run 'man output' for more info", flag, outputParts[1])
}

return errfmt.Errorf("invalid uri for %s output %q. Use '--output help' for more info", flag, outputParts[1])
Expand Down

0 comments on commit d63110a

Please sign in to comment.