Commit b4ade07
committed
feat: allow
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.generate command to generate a single DBC file1 parent 56c0075 commit b4ade07
2 files changed
+49
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
75 | 75 | | |
76 | 76 | | |
77 | 77 | | |
78 | | - | |
| 78 | + | |
79 | 79 | | |
80 | 80 | | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 90 | + | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
81 | 118 | | |
82 | 119 | | |
83 | 120 | | |
84 | 121 | | |
| 122 | + | |
| 123 | + | |
85 | 124 | | |
86 | 125 | | |
87 | 126 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
44 | 44 | | |
45 | 45 | | |
46 | 46 | | |
47 | | - | |
48 | | - | |
| 47 | + | |
| 48 | + | |
49 | 49 | | |
50 | | - | |
| 50 | + | |
51 | 51 | | |
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
56 | | - | |
| 56 | + | |
57 | 57 | | |
58 | 58 | | |
59 | 59 | | |
60 | 60 | | |
61 | 61 | | |
62 | 62 | | |
63 | | - | |
| 63 | + | |
64 | 64 | | |
65 | 65 | | |
66 | 66 | | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
67 | 71 | | |
68 | 72 | | |
69 | 73 | | |
| |||
0 commit comments