Skip to content

Conversation

@fmuyassarov
Copy link
Member

Improve user experience.

  • add usage examples to export and compat commands
  • add -p short flag for --path option
  • silence usage output on runtime errors for cleaner error messages

Examples

  1. Usage silencing (before)

    $ ./bin/nfd export features --pathd
    Error: unknown flag: --pathd
    Usage:
      nfd export features [flags]
    
    Flags:
      -h, --help          help for features
          --path string   export to this JSON path
    
    unknown flag: --pathd
    

    after

    $ ./bin/nfd export features --pathd
    Error: unknown flag: --pathd
    unknown flag: --pathd
    

    before

    $  ./bin/nfd  compat validate-node --output-jsond true
    Error: unknown flag: --output-jsond
    Usage:
      nfd compat validate-node [flags]
    
    Flags:
      -h, --help                       help for validate-node
          --image string               the URL of the image containing compatibility metadata
          --output-json                print a JSON object
          --plain-http                 use of HTTP protocol for all registry communications
          --platform string            the artifact platform in the format os[/arch][/variant][:os_version]
          --registry-password-stdin    read registry password from stdin
          --registry-token-stdin       read registry access token from stdin
          --registry-username string   registry username
          --tags strings               a list of tags that must match the tags set on the compatibility objects
    
    unknown flag: --output-jsond
    

    after

    $ ./bin/nfd  compat validate-node --output-jsond true
    Error: unknown flag: --output-jsond
    unknown flag: --output-jsond
    
  2. Helper examples:

    $ ./bin/nfd export features -h
    Export features for given node
    
    Usage:
      nfd export features [flags]
    
    Examples:
    
    # Export node features to stdout (prints to terminal)
    nfd export features
    
    # Export node features to a file instead
    nfd export features --path /tmp/features.json
    
    Flags:
      -h, --help          help for features
      -p, --path string   export to this JSON path
    

- Add usage examples to export and compat commands
- Add `-p` short flag for `--path` option
- Silence usage output on runtime errors for cleaner error messages

Signed-off-by: Feruzjon Muyassarov <[email protected]>
@netlify
Copy link

netlify bot commented Oct 29, 2025

Deploy Preview for kubernetes-sigs-nfd ready!

Name Link
🔨 Latest commit f06db58
🔍 Latest deploy log https://app.netlify.com/projects/kubernetes-sigs-nfd/deploys/69021471c6ad6c00088b4441
😎 Deploy Preview https://deploy-preview-2349--kubernetes-sigs-nfd.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Oct 29, 2025
@k8s-ci-robot k8s-ci-robot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Oct 29, 2025
Copy link
Contributor

@marquiz marquiz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @fmuyassarov for the enhancement, looks good to me

@mfranczy @ChaoyiHuang @vsoch

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: fmuyassarov, marquiz

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Oct 29, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants