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

Unable to generate json output using --format flag #796

Open
r0075h3ll opened this issue Feb 10, 2025 · 3 comments
Open

Unable to generate json output using --format flag #796

r0075h3ll opened this issue Feb 10, 2025 · 3 comments

Comments

@r0075h3ll
Copy link

r0075h3ll commented Feb 10, 2025

Hi There

I'm unable to generate json output for a malware scan using this command: mal scan -i metal3d/xmrig --format=json

Output

Incorrect Usage: flag provided but not defined: -format

NAME:
   malcontent analyze - fully interrogate a path

USAGE:
   malcontent analyze command [command options]

COMMANDS:
   help, h  Shows a list of commands or help for one command

OPTIONS:
   --image value, -i value  Scan an image
   --processes              Scan the commands (paths) of running processes (default: false)
   --help, -h               show help
💣 flag provided but not defined: -format

Thanks

@tstromberg
Copy link
Collaborator

malcontent currently requires global flags to be provided before the sub-command. Try this:

mal --format=json scan -i metal3d/xmrig

This quirk trips me up all the time; I think this is good evidence that we should consider changing our flag handling so that global flags (ones that can be applied to multiple subcommands) can be specified anywhere.

@r0075h3ll
Copy link
Author

Hi @tstromberg, this works, thank you.

Also, regarding the flags, mind if I take a look and raise a PR for the same?

@tstromberg
Copy link
Collaborator

tstromberg commented Feb 11, 2025 via email

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

No branches or pull requests

2 participants