Skip to content

have CLI print help message if invalid number of args passsed #111

Open
@albertlockett

Description

Version

No response

Linux Version

No response

Is your feature request related to a problem? Please describe.

It would be nice if the CLI would print the help message for the command if there is an invalid number of arguments passed.

For example:

$ ~/go/bin/bee package hello                   
Error: accepts 2 arg(s), received 1
2024/02/15 16:59:00 exiting: accepts 2 arg(s), received 1

I would prefer if it printed this:

cmd := &cobra.Command{
Use: "package REGISTRY_REF DOCKER_IMAGE",
Short: "Package a BPF program OCI image with the `bee` runner in a docker image",
Long: `
The package command is used to package the desired BPF program along with the 'bee' runner in a Docker image.
This means that the resulting docker image is a single, runnable unit to load and attach your BPF proograms.
You can then ship this image around anywhere you run docker images, e.g. K8s.
Example workflow:
$ bee build examples/tcpconnect/tcpconnect.c tcpconnect
$ bee package tcpconnect bee-tcpconnect:latest
# deploy 'bee-tcpconnect:latest' to K8s cluster

Describe the solution you'd like

No response

Describe alternatives you've considered

No response

Additional Context

No response

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions