Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

remove --help, fix help command for flags #3302

Closed
wants to merge 1 commit into from

Conversation

geyslan
Copy link
Member

@geyslan geyslan commented Jul 6, 2023

Close #3299

1. Explain what the PR does

b549093 fix(flags)!: remove --help, fix help command (2023/jul/06) Geyslan Gregório <geyslan@gmail.com>

The --help workaround for flags is removed, and the help command is
fixed to work as expected for both commands and flags.

BREAKING CHANGE: --help is no longer supported for flags. Use:
 - "tracee [command] --help" for more information about a command.
 - "tracee help [command|flag]" for more information about a command or
    flag.

2. Explain how to test it

Ask for a command help list (generated by cobra):

./dist/tracee help list

List traceable events

Usage:
  tracee list

Aliases:
  list, l

Flags:
      --signatures-dir stringArray   Directories where to search for signatures in CEL (.yaml), OPA (.rego), and Go plugin (.so) formats

Ask for a flag help --config (our own text, since cobra doesn't provide help cmd for flags):

./dist/tracee help config

The --config flag allows you to define global configuration options (flags)
for tracee, by providing a file in YAML or JSON format between others (see documentation).

All flags can be set in the config file, except for the following, which are reserved only
for the CLI:
  --config (this flag)
  --capture
  --policy

The --filter flag also cannot be set in the config file since it's reserved for the CLI
and the policy file loading mechanism (via the --policy flag).

Ask for a general help (generated by cobra based on specified template):

./dist/tracee help

Tracee uses eBPF technology to tap into your system and give you
access to hundreds of events that help you understand how your system behaves.

Usage:
  tracee [flags]
  tracee [command]

Available Commands:
  analyze     Analyze past events with signature events [Experimental]
  completion  Generate the autocompletion script for the specified shell
  help        Help about any command or flag
  list        List traceable events
  version     Print the version number of Tracee

Flags:
  -f, --filter stringArray           Select events to trace by defining filter expressions
  -p, --policy stringArray           Path to a policy or directory with policies
  -o, --output stringArray           Control how and where output is printed (default [table])
  -c, --capture stringArray          Capture artifacts that were written, executed or found to be suspicious
      --config string                Global config file (yaml, json between others - see documentation)
      --containers                   Enable container info enrichment to events. This feature is experimental and may cause unexpected behavior in the pipeline
      --crs stringArray              Define connected container runtimes
      --signatures-dir stringArray   Directories where to search for signatures in CEL (.yaml), OPA (.rego), and Go plugin (.so) formats
      --rego stringArray             Control event rego settings
  -b, --perf-buffer-size int         Size, in pages, of the internal perf ring buffer used to submit events from the kernel (default 1024)
      --blob-perf-buffer-size int    Size, in pages, of the internal perf ring buffer used to send blobs from the kernel (default 1024)
  -a, --cache stringArray            Control event caching queues (default [none])
      --metrics                      Enable metrics endpoint
      --healthz                      Enable healthz endpoint
      --pprof                        Enable pprof endpoints
      --pyroscope                    Enable pyroscope agent
      --listen-addr string           Listening address of the metrics endpoint server (default ":3366")
  -C, --capabilities stringArray     Define capabilities for tracee to run with
      --install-path string          Path where tracee will install or lookup it's resources (default "/tmp/tracee")
  -l, --log stringArray              Logger options (default [info])

Use:
  "tracee [command] --help" for more information about a command.
  "tracee help [command|flag]" for more information about a command or flag.

3. Other comments

It's important to note that --help continues to function as a flag for commands.

The --help workaround for flags is removed, and the help command is
fixed to work as expected for both commands and flags.

BREAKING CHANGE: --help is no longer supported for flags. Use:
 - "tracee [command] --help" for more information about a command.
 - "tracee help [command|flag]" for more information about a command or
    flag.
@geyslan
Copy link
Member Author

geyslan commented Jul 12, 2023

@yanivagman, as we discussed in today's meeting, due to change of plans, I'm closing this and pushing soon a new solution with:

In a further PR, we can add pandoc or other tool to convert the markdowns to man pages during the package build etc. @rafaeldtinoco FYI

@geyslan geyslan closed this Jul 12, 2023
@geyslan geyslan deleted the 3299-help-cmd branch July 31, 2023 22:18
@geyslan geyslan restored the 3299-help-cmd branch July 31, 2023 22:18
@geyslan geyslan deleted the 3299-help-cmd branch July 31, 2023 22:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Help subcommand doesn't work as expected
1 participant