Skip to content

cmdline: Prevent exception when ddata is called with no arguments - #304

Merged
waskyo merged 1 commit into
static-analysis-engineering:masterfrom
waskyo:ddata_parser_default
Oct 29, 2026
Merged

waskyo merged 1 commit into
static-analysis-engineering:masterfrom
waskyo:ddata_parser_default

Conversation

@waskyo

@waskyo waskyo commented Oct 29, 2026

Copy link
Copy Markdown
Collaborator

The chkx command line parser assumes set_defaults has been called with a 'func' argument and ddata wasn't doing that.

This would cause an exception to be raised if you call ddata by itself:

$ chkx ddata
Traceback (most recent call last):
  File ".../chb/cmdline/chkx", line 2047, in <module>
    args.func(args)
    ^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'func'

To keep things simple, the default function just tells the user to run with --help to get all the details.

$ chkx ddata
Run ddata --help to see available subcommands

The chkx command line parser assumes set_defaults has been called
with a 'func' argument and ddata wasn't doing that.

This would cause an exception to be raised if you call ddata by itself:
```
$ chkx ddata
Traceback (most recent call last):
  File ".../chb/cmdline/chkx", line 2047, in <module>
    args.func(args)
    ^^^^^^^^^
AttributeError: 'Namespace' object has no attribute 'func'
```

To keep things simple, the default function just tells the user to run
with --help to get all the details.

```
$ chkx ddata
Run ddata --help to see available subcommands
```

@sipma sipma left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Thank you for fixing that!

@waskyo
waskyo merged commit 0a4e877 into static-analysis-engineering:master Oct 29, 2026
4 checks passed
@waskyo
waskyo deleted the ddata_parser_default branch October 29, 2026 13:57
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