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

add color flag #339

Merged
merged 2 commits into from
Oct 31, 2024
Merged

add color flag #339

merged 2 commits into from
Oct 31, 2024

Conversation

viveksahu26
Copy link
Collaborator

Add flag for color output.
go run main.go compliance -f --color=false ../lynk-api/scripts/samples/misc/ascii-boxes-sbom-cdx.json

Command help:

$ go run main.go compliance -h
Check if your SBOM complies with various SBOM standards like NTIA minimum elements, BSI TR-03183-2, OpenChain Telco.
	Generate a compliance report for an SBOM file.

Usage:
  sbomqs compliance <sbom file> [flags]

Examples:
 sbomqs compliance --bsi|--oct  [--basic|--json] <SBOM file>

  # Check a BSI TR-03183-2 v1.1 compliance against a SBOM in a table output
  sbomqs compliance --bsi samples/sbomqs-spdx-syft.json

  # Check a BSI TR-03183-2 v1.1 compliance against a SBOM in a JSON output
  sbomqs compliance --bsi --json samples/sbomqs-spdx-syft.json

  # Check a OpenChain Telco compliance against a SBOM in a table output
  sbomqs compliance --oct samples/sbomqs-spdx-syft.json

  # Check a OpenChain Telco compliance against a SBOM in a JSON output
  sbomqs compliance --oct --json samples/sbomqs-spdx-syft.json

  # Check a V3 Framing document compliance  against a SBOM in a table output
  sbomqs compliance --fsct <sbom>

  # Check a V3 Framing document compliance  against a SBOM in a JSON output
  sbomqs compliance --fsct -j <sbom>


Flags:
  -b, --basic      output in basic format
  -c, --bsi        BSI TR-03183-2 v1.1 compliance
  -l, --color      output in colorful
  -D, --debug      enable debug logging
  -d, --detailed   output in detailed format
  -f, --fsct       V3 Framing document compliance
  -h, --help       help for compliance
  -j, --json       output in json format
  -n, --ntia       check for NTIA minimum elements compliance
  -t, --oct        OpenChainTelco compliance

Signed-off-by: Vivek Kumar Sahu <[email protected]>
Signed-off-by: Vivek Kumar Sahu <[email protected]>
complianceCmd.Flags().BoolP("json", "j", false, "output in json format")
complianceCmd.Flags().BoolP("basic", "b", false, "output in basic format")
complianceCmd.Flags().BoolP("detailed", "d", false, "output in detailed format")
complianceCmd.Flags().BoolP("color", "l", false, "output in colorful")
Copy link
Contributor

Choose a reason for hiding this comment

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

color mode on

Copy link
Contributor

Choose a reason for hiding this comment

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

this should always default to off.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Our motive is to make it off until and unless explicity it is turned on via --color=true or -l

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Do we need to make it on or off, by default ?

Copy link
Contributor

Choose a reason for hiding this comment

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

off

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

so, yeah that's what parameter (false) signifies to.

@riteshnoronha riteshnoronha merged commit 5d34723 into interlynk-io:main Oct 31, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants