Commit 495c9b2
Allow aliases for run_opt (#1141)
Summary:
Lets allow aliases for a runopt. This will give downstream users to have multiple ways of accessing the same runopt.
* Introduce new class for `runopt.alias` which is used to expand on adding aliases to a runopt.
* Add a new dict to maintain alias to key values that can be used by `opt.get(name)`
* Modify add() to accept list as well, build out the aliases list and modify the previously created dict to fill in alias to primary_key values.
* Modify resolve() to check if a different alias is already used in cfg i.e if the "jobPriority" and "job_priority" are aliases for the same one, we don't allow for both to be present in the cfg.
* Modify get to look at the alias to primary_key dict as well.
Reviewed By: kiukchung
Differential Revision: D841578701 parent 6c03c7e commit 495c9b2
2 files changed
+111
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
891 | 891 | | |
892 | 892 | | |
893 | 893 | | |
| 894 | + | |
| 895 | + | |
| 896 | + | |
894 | 897 | | |
895 | 898 | | |
896 | 899 | | |
897 | 900 | | |
| 901 | + | |
898 | 902 | | |
899 | 903 | | |
900 | 904 | | |
| |||
986 | 990 | | |
987 | 991 | | |
988 | 992 | | |
| 993 | + | |
989 | 994 | | |
990 | 995 | | |
991 | 996 | | |
| |||
1013 | 1018 | | |
1014 | 1019 | | |
1015 | 1020 | | |
1016 | | - | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
| 1024 | + | |
1017 | 1025 | | |
1018 | | - | |
| 1026 | + | |
| 1027 | + | |
| 1028 | + | |
| 1029 | + | |
| 1030 | + | |
1019 | 1031 | | |
1020 | 1032 | | |
1021 | 1033 | | |
| |||
1030 | 1042 | | |
1031 | 1043 | | |
1032 | 1044 | | |
| 1045 | + | |
| 1046 | + | |
| 1047 | + | |
| 1048 | + | |
| 1049 | + | |
| 1050 | + | |
| 1051 | + | |
| 1052 | + | |
| 1053 | + | |
| 1054 | + | |
| 1055 | + | |
| 1056 | + | |
| 1057 | + | |
| 1058 | + | |
| 1059 | + | |
| 1060 | + | |
| 1061 | + | |
| 1062 | + | |
1033 | 1063 | | |
1034 | 1064 | | |
1035 | 1065 | | |
| |||
1049 | 1079 | | |
1050 | 1080 | | |
1051 | 1081 | | |
1052 | | - | |
| 1082 | + | |
1053 | 1083 | | |
1054 | 1084 | | |
1055 | 1085 | | |
| |||
1142 | 1172 | | |
1143 | 1173 | | |
1144 | 1174 | | |
| 1175 | + | |
| 1176 | + | |
| 1177 | + | |
| 1178 | + | |
| 1179 | + | |
| 1180 | + | |
| 1181 | + | |
| 1182 | + | |
| 1183 | + | |
| 1184 | + | |
| 1185 | + | |
| 1186 | + | |
| 1187 | + | |
| 1188 | + | |
| 1189 | + | |
| 1190 | + | |
| 1191 | + | |
| 1192 | + | |
| 1193 | + | |
| 1194 | + | |
| 1195 | + | |
| 1196 | + | |
| 1197 | + | |
| 1198 | + | |
| 1199 | + | |
| 1200 | + | |
| 1201 | + | |
| 1202 | + | |
| 1203 | + | |
1145 | 1204 | | |
1146 | 1205 | | |
1147 | | - | |
| 1206 | + | |
1148 | 1207 | | |
1149 | 1208 | | |
1150 | 1209 | | |
| |||
1155 | 1214 | | |
1156 | 1215 | | |
1157 | 1216 | | |
| 1217 | + | |
1158 | 1218 | | |
1159 | 1219 | | |
1160 | 1220 | | |
| |||
1165 | 1225 | | |
1166 | 1226 | | |
1167 | 1227 | | |
1168 | | - | |
1169 | | - | |
| 1228 | + | |
| 1229 | + | |
| 1230 | + | |
| 1231 | + | |
1170 | 1232 | | |
1171 | 1233 | | |
1172 | 1234 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
578 | 578 | | |
579 | 579 | | |
580 | 580 | | |
| 581 | + | |
| 582 | + | |
| 583 | + | |
| 584 | + | |
| 585 | + | |
| 586 | + | |
| 587 | + | |
| 588 | + | |
| 589 | + | |
| 590 | + | |
| 591 | + | |
| 592 | + | |
| 593 | + | |
| 594 | + | |
| 595 | + | |
| 596 | + | |
| 597 | + | |
| 598 | + | |
| 599 | + | |
| 600 | + | |
| 601 | + | |
| 602 | + | |
| 603 | + | |
| 604 | + | |
| 605 | + | |
| 606 | + | |
| 607 | + | |
| 608 | + | |
| 609 | + | |
| 610 | + | |
| 611 | + | |
| 612 | + | |
| 613 | + | |
| 614 | + | |
| 615 | + | |
| 616 | + | |
| 617 | + | |
| 618 | + | |
| 619 | + | |
| 620 | + | |
| 621 | + | |
| 622 | + | |
| 623 | + | |
581 | 624 | | |
582 | 625 | | |
583 | 626 | | |
| |||
0 commit comments