Commit 3ac3a1e
Use auto aliasing for cases for the runopt
Summary:
Introduces enum for auto aliasing based on casing for the runopt nam
```
class AutoAlias(IntEnum):
snake_case = 0x1
SNAKE_CASE = 0x2
camelCase = 0x4
```
So user can extend name to be used as
```
opts.add(
["job_priority", runopt.AutoAlias.camelCase],
type_=str,
help="run as user",
)
opts.add(
[
"model_type_name",
runopt.AutoAlias.camelCase | runopt.AutoAlias.SNAKE_CASE,
],
type_=str,
help="run as user",
)
```
This should automatically produce additional aliases of `jobPriority` to `job_priority` and produce `modelTypeName` and `MODEL_TYPE_NAME` for `model_type_name`
Differential Revision: D841925601 parent 695fd17 commit 3ac3a1e
2 files changed
+62
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
21 | | - | |
| 21 | + | |
22 | 22 | | |
23 | 23 | | |
24 | 24 | | |
| |||
38 | 38 | | |
39 | 39 | | |
40 | 40 | | |
| 41 | + | |
| 42 | + | |
41 | 43 | | |
42 | 44 | | |
43 | 45 | | |
| |||
893 | 895 | | |
894 | 896 | | |
895 | 897 | | |
| 898 | + | |
| 899 | + | |
| 900 | + | |
| 901 | + | |
| 902 | + | |
896 | 903 | | |
897 | 904 | | |
898 | 905 | | |
| |||
903 | 910 | | |
904 | 911 | | |
905 | 912 | | |
906 | | - | |
907 | | - | |
| 913 | + | |
| 914 | + | |
908 | 915 | | |
909 | 916 | | |
910 | 917 | | |
| |||
1190 | 1197 | | |
1191 | 1198 | | |
1192 | 1199 | | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
| 1204 | + | |
| 1205 | + | |
| 1206 | + | |
| 1207 | + | |
| 1208 | + | |
| 1209 | + | |
| 1210 | + | |
| 1211 | + | |
| 1212 | + | |
1193 | 1213 | | |
1194 | 1214 | | |
1195 | | - | |
1196 | | - | |
| 1215 | + | |
| 1216 | + | |
1197 | 1217 | | |
1198 | 1218 | | |
1199 | 1219 | | |
1200 | 1220 | | |
1201 | | - | |
| 1221 | + | |
1202 | 1222 | | |
1203 | 1223 | | |
1204 | 1224 | | |
1205 | 1225 | | |
1206 | | - | |
1207 | | - | |
| 1226 | + | |
| 1227 | + | |
| 1228 | + | |
1208 | 1229 | | |
1209 | 1230 | | |
1210 | | - | |
| 1231 | + | |
1211 | 1232 | | |
1212 | | - | |
| 1233 | + | |
| 1234 | + | |
| 1235 | + | |
1213 | 1236 | | |
1214 | 1237 | | |
1215 | 1238 | | |
| |||
1220 | 1243 | | |
1221 | 1244 | | |
1222 | 1245 | | |
| 1246 | + | |
| 1247 | + | |
| 1248 | + | |
| 1249 | + | |
| 1250 | + | |
| 1251 | + | |
1223 | 1252 | | |
1224 | 1253 | | |
1225 | 1254 | | |
1226 | 1255 | | |
1227 | | - | |
| 1256 | + | |
1228 | 1257 | | |
1229 | 1258 | | |
1230 | 1259 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
640 | 640 | | |
641 | 641 | | |
642 | 642 | | |
| 643 | + | |
| 644 | + | |
| 645 | + | |
| 646 | + | |
| 647 | + | |
| 648 | + | |
| 649 | + | |
| 650 | + | |
| 651 | + | |
| 652 | + | |
| 653 | + | |
| 654 | + | |
| 655 | + | |
| 656 | + | |
| 657 | + | |
| 658 | + | |
| 659 | + | |
| 660 | + | |
| 661 | + | |
| 662 | + | |
| 663 | + | |
| 664 | + | |
643 | 665 | | |
644 | 666 | | |
645 | 667 | | |
| |||
0 commit comments