-
Notifications
You must be signed in to change notification settings - Fork 38
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: allow
generate
command to generate a single DBC file
This commit allows a user to run cantool generate INPUT OUTPUT-DIRECTORY where INPUT is either a path to a DBC file. Previously it was only possible to provide INPUT as a directory containing DBC files. N.B. When INPUT is a directory containing DBC files the generated files are created in OUTPUT-DIRECTORY relative to where they are found in INPUT. As an example, given the following directory structure: dbc/ powertrain/pt.dbc steering/steer.dbc brake/brake.dbc A `cantool generate dbc/ gen/go` call will generate the following structure: gen/go/ powertrain/pt.dbc.go steering/steer.dbc.go brake/brake.dbc.go However, when INPUT is a single DBC file it is generated directly in OUTPUT-DIRECTORY with its basename as the stem. `cantool generate dbc/steering/steer.dbc gen/go/steering` will therefore generate the gen/go/steering/steer.dbc.go.
- Loading branch information
Showing
2 changed files
with
49 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters