Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

566 lines
9.0 KiB

  1. //+----------------------------------------------------------------------------
  2. //
  3. // Microsoft Windows
  4. // Copyright (C) Microsoft Corporation, 1992 - 2001
  5. //
  6. // File: cmdtable.cxx
  7. //
  8. // Contents: Defines tables which contain the command line arguments.
  9. //
  10. // History: 26-Mar-2001 EricB Created
  11. //
  12. //-----------------------------------------------------------------------------
  13. #include "pch.h"
  14. #pragma hdrstop
  15. #include <netdom.h>
  16. #include "cmdtable.h"
  17. //+----------------------------------------------------------------------------
  18. // Parser tables
  19. //-----------------------------------------------------------------------------
  20. ARG_RECORD rgNetDomPriArgs[] =
  21. {
  22. //
  23. // Primary operation commands
  24. //
  25. //
  26. // help, h
  27. //
  28. {MSG_TAG_HELP, NULL,
  29. MSG_TAG_HELPSHORT, NULL,
  30. ARG_TYPE_HELP, 0,
  31. (CMD_TYPE)FALSE,
  32. 0, NULL},
  33. //
  34. // ?
  35. //
  36. {MSG_TAG_QHELP, NULL,
  37. ID_ARG2_NULL, NULL,
  38. ARG_TYPE_HELP, 0,
  39. (CMD_TYPE)FALSE,
  40. 0, NULL},
  41. //
  42. // Add primary command
  43. //
  44. {MSG_TAG_ADD, NULL,
  45. ID_ARG2_NULL, NULL,
  46. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  47. 0,
  48. 0, NULL},
  49. //
  50. // ComputerName primary command
  51. //
  52. {MSG_TAG_COMPNAME, NULL,
  53. ID_ARG2_NULL, NULL,
  54. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  55. 0,
  56. 0, NULL},
  57. //
  58. // Join primary command
  59. //
  60. {MSG_TAG_JOIN, NULL,
  61. ID_ARG2_NULL, NULL,
  62. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  63. 0,
  64. 0, NULL},
  65. //
  66. // Move primary command
  67. //
  68. {MSG_TAG_MOVE, NULL,
  69. ID_ARG2_NULL, NULL,
  70. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  71. 0,
  72. 0, NULL},
  73. //
  74. // Query primary command
  75. //
  76. {MSG_TAG_QUERY, NULL,
  77. ID_ARG2_NULL, NULL,
  78. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  79. 0,
  80. 0, NULL},
  81. //
  82. // Remove primary command
  83. //
  84. {MSG_TAG_REMOVE, NULL,
  85. ID_ARG2_NULL, NULL,
  86. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  87. 0,
  88. 0, NULL},
  89. //
  90. // Rename primary command
  91. //
  92. {MSG_TAG_RENAME, NULL,
  93. ID_ARG2_NULL, NULL,
  94. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  95. 0,
  96. 0, NULL},
  97. //
  98. // Rename Computer primary command
  99. //
  100. {MSG_TAG_RENAMECOMPUTER, NULL,
  101. ID_ARG2_NULL, NULL,
  102. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  103. 0,
  104. 0, NULL},
  105. //
  106. // Reset primary command
  107. //
  108. {MSG_TAG_RESET, NULL,
  109. ID_ARG2_NULL, NULL,
  110. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  111. 0,
  112. 0, NULL},
  113. //
  114. // Reset Password primary command
  115. //
  116. {MSG_TAG_RESETPWD, NULL,
  117. ID_ARG2_NULL, NULL,
  118. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  119. 0,
  120. 0, NULL},
  121. //
  122. // Trust primary command
  123. //
  124. {MSG_TAG_TRUST, NULL,
  125. ID_ARG2_NULL, NULL,
  126. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  127. 0,
  128. 0, NULL},
  129. //
  130. // Verify primary command
  131. //
  132. {MSG_TAG_VERIFY, NULL,
  133. ID_ARG2_NULL, NULL,
  134. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  135. 0,
  136. 0, NULL},
  137. //
  138. // Time primary command
  139. //
  140. {MSG_TAG_TIME, NULL,
  141. ID_ARG2_NULL, NULL,
  142. ARG_TYPE_VERB, ARG_FLAG_ATLEASTONE | ARG_FLAG_VERB,
  143. 0,
  144. 0, NULL},
  145. {ARG_TERMINATOR}
  146. };
  147. ARG_RECORD rgNetDomArgs[] =
  148. {
  149. //
  150. // Object name
  151. //
  152. {0, L"Object",
  153. ID_ARG2_NULL, NULL,
  154. ARG_TYPE_STR, ARG_FLAG_OBJECT,
  155. NULL,
  156. 0, NULL},
  157. //
  158. // Query operations
  159. //
  160. //
  161. // PDC
  162. //
  163. {MSG_TAG_QUERY_PDC, NULL,
  164. ID_ARG2_NULL, NULL,
  165. ARG_TYPE_VERB, ARG_FLAG_VERB,
  166. NULL,
  167. 0, NULL},
  168. //
  169. // SERVER
  170. //
  171. {MSG_TAG_QUERY_SERVER, NULL,
  172. ID_ARG2_NULL, NULL,
  173. ARG_TYPE_VERB, ARG_FLAG_VERB,
  174. NULL,
  175. 0, NULL},
  176. //
  177. // WORKSTATION
  178. //
  179. {MSG_TAG_QUERY_WKSTA, NULL,
  180. ID_ARG2_NULL, NULL,
  181. ARG_TYPE_VERB, ARG_FLAG_VERB,
  182. NULL,
  183. 0, NULL},
  184. //
  185. // DC
  186. //
  187. {MSG_TAG_QUERY_DC, NULL,
  188. ID_ARG2_NULL, NULL,
  189. ARG_TYPE_VERB, ARG_FLAG_VERB,
  190. NULL,
  191. 0, NULL},
  192. //
  193. // OU
  194. //
  195. {MSG_TAG_QUERY_OU, NULL,
  196. ID_ARG2_NULL, NULL,
  197. ARG_TYPE_VERB, ARG_FLAG_VERB,
  198. NULL,
  199. 0, NULL},
  200. //
  201. // FSMO
  202. //
  203. {MSG_TAG_QUERY_FSMO, NULL,
  204. ID_ARG2_NULL, NULL,
  205. ARG_TYPE_VERB, ARG_FLAG_VERB,
  206. NULL,
  207. 0, NULL},
  208. //
  209. // TRUST
  210. //
  211. {MSG_TAG_QUERY_TRUST, NULL,
  212. ID_ARG2_NULL, NULL,
  213. ARG_TYPE_VERB, ARG_FLAG_VERB,
  214. NULL,
  215. 0, NULL},
  216. //
  217. // Common switches
  218. //
  219. //
  220. // help, h
  221. //
  222. {MSG_TAG_HELP, NULL,
  223. MSG_TAG_HELPSHORT, NULL,
  224. ARG_TYPE_HELP, 0,
  225. (CMD_TYPE)FALSE,
  226. 0, NULL},
  227. //
  228. // ?
  229. //
  230. {MSG_TAG_QHELP, NULL,
  231. ID_ARG2_NULL, NULL,
  232. ARG_TYPE_HELP, 0,
  233. (CMD_TYPE)FALSE,
  234. 0, NULL},
  235. //
  236. // UserO, uo
  237. //
  238. {MSG_TAG_USERO, NULL,
  239. MSG_TAG_USERO_SHORT, NULL,
  240. ARG_TYPE_STR, 0,
  241. NULL,
  242. 0, NULL},
  243. //
  244. // PasswordO, po
  245. //
  246. {MSG_TAG_PO, NULL,
  247. MSG_TAG_PO_SHORT, NULL,
  248. ARG_TYPE_STR, ARG_FLAG_DEFAULTABLE,
  249. (CMD_TYPE)L"",
  250. 0, NULL}, //ValidateAdminPassword,
  251. //
  252. // UserD, ud
  253. //
  254. {MSG_TAG_USERD, NULL,
  255. MSG_TAG_USERD_SHORT, NULL,
  256. ARG_TYPE_STR, 0,
  257. NULL,
  258. 0, NULL},
  259. //
  260. // PasswordD, pd
  261. //
  262. {MSG_TAG_PD, NULL,
  263. MSG_TAG_PD_SHORT, NULL,
  264. ARG_TYPE_STR, ARG_FLAG_DEFAULTABLE,
  265. (CMD_TYPE)L"",
  266. 0, NULL}, //ValidateAdminPassword,
  267. //
  268. // Domain, d
  269. //
  270. {MSG_TAG_DOMAIN, NULL,
  271. MSG_TAG_DOMAIN_SHORT, NULL,
  272. ARG_TYPE_STR, 0,
  273. NULL,
  274. 0, NULL},
  275. //
  276. // OU
  277. //
  278. {MSG_TAG_OU, NULL,
  279. ID_ARG2_NULL, NULL,
  280. ARG_TYPE_STR, 0,
  281. NULL,
  282. 0, NULL},
  283. //
  284. // Verify sub command, v
  285. //
  286. {MSG_TAG_TVERIFY, NULL,
  287. MSG_TAG_TVERIFY_SHORT, NULL,
  288. ARG_TYPE_BOOL, 0,
  289. NULL,
  290. 0, NULL},
  291. //
  292. // Verbose
  293. //
  294. {MSG_TAG_VERBOSE, NULL,
  295. ID_ARG2_NULL, NULL,
  296. ARG_TYPE_BOOL, 0,
  297. NULL,
  298. 0, NULL},
  299. //
  300. // Server, s
  301. //
  302. {MSG_TAG_SERVER, NULL,
  303. MSG_TAG_SERVER_SHORT, NULL,
  304. ARG_TYPE_STR, 0,
  305. NULL,
  306. 0, NULL},
  307. //
  308. // Reset sub command, rese
  309. //
  310. {MSG_TAG_TRESET, NULL,
  311. MSG_TAG_TRESET_SHORT, NULL,
  312. ARG_TYPE_BOOL, 0,
  313. NULL,
  314. 0, NULL},
  315. //
  316. // Reboot, reb
  317. //
  318. {MSG_TAG_RESTART, NULL,
  319. MSG_TAG_RESTART_SHORT, NULL,
  320. ARG_TYPE_INT, ARG_FLAG_DEFAULTABLE,
  321. (CMD_TYPE)30,
  322. 0, NULL},
  323. //
  324. // Force
  325. //
  326. {MSG_TAG_FORCE, NULL,
  327. ID_ARG2_NULL, NULL,
  328. ARG_TYPE_BOOL, 0,
  329. NULL,
  330. 0, NULL},
  331. //
  332. // Help switch
  333. //
  334. //
  335. // Syntax
  336. //
  337. {MSG_TAG_SYNTAX, NULL,
  338. ID_ARG2_NULL, NULL,
  339. ARG_TYPE_BOOL, 0,
  340. NULL,
  341. 0, NULL},
  342. //
  343. // Add switch
  344. //
  345. //
  346. // DC
  347. //
  348. {MSG_TAG_ADD_DC, NULL,
  349. ID_ARG2_NULL, NULL,
  350. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  351. (CMD_TYPE)L"",
  352. 0, NULL},
  353. //
  354. // Move switches
  355. //
  356. //
  357. // UserF, uf
  358. //
  359. {MSG_TAG_USERF, NULL,
  360. MSG_TAG_USERF_SHORT, NULL,
  361. ARG_TYPE_STR, 0,
  362. NULL,
  363. 0, NULL},
  364. //
  365. // PasswordF, pf
  366. //
  367. {MSG_TAG_PF, NULL,
  368. MSG_TAG_PF_SHORT, NULL,
  369. ARG_TYPE_STR, ARG_FLAG_DEFAULTABLE,
  370. (CMD_TYPE)L"",
  371. 0, NULL}, //ValidateAdminPassword,
  372. //
  373. // Query switch
  374. //
  375. //
  376. // Direct
  377. //
  378. {MSG_TAG_DIRECT, NULL,
  379. MSG_TAG_DIRECT_SHORT, NULL,
  380. ARG_TYPE_BOOL, 0,
  381. NULL,
  382. 0, NULL},
  383. //
  384. // Rename Computer switch
  385. //
  386. //
  387. // NewName
  388. //
  389. {MSG_TAG_NEW_NAME, NULL,
  390. ID_ARG2_NULL, NULL,
  391. ARG_TYPE_STR, 0,
  392. NULL,
  393. 0, NULL},
  394. //
  395. // Trust switches
  396. //
  397. //
  398. // Realm, rea
  399. //
  400. {MSG_TAG_REALM, NULL,
  401. MSG_TAG_REALM_SHORT, NULL,
  402. ARG_TYPE_BOOL, 0,
  403. NULL,
  404. 0, NULL},
  405. //
  406. // PasswordT, pt
  407. //
  408. {MSG_TAG_PT, NULL,
  409. MSG_TAG_PT_SHORT, NULL,
  410. ARG_TYPE_STR, 0,
  411. (CMD_TYPE)L"",
  412. 0, NULL},
  413. //
  414. // Add, a, also used by CompName
  415. //
  416. {MSG_TAG_TADD, NULL,
  417. MSG_TAG_TADD_SHORT, NULL,
  418. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  419. (CMD_TYPE)L"",
  420. 0, NULL},
  421. //
  422. // Remove, rem, also used by CompName
  423. //
  424. {MSG_TAG_TREMOVE, NULL,
  425. MSG_TAG_TREMOVE_SHORT, NULL,
  426. ARG_TYPE_STR, ARG_FLAG_OPTIONAL,
  427. (CMD_TYPE)L"",
  428. 0, NULL},
  429. //
  430. // TwoWay, t
  431. //
  432. {MSG_TAG_TWOWAY, NULL,
  433. MSG_TAG_TWOWAY_SHORT, NULL,
  434. ARG_TYPE_BOOL, 0,
  435. NULL,
  436. 0, NULL},
  437. //
  438. // Kerberos, k
  439. //
  440. {MSG_TAG_KERBEROS, NULL,
  441. MSG_TAG_KERBEROS_SHORT, NULL,
  442. ARG_TYPE_BOOL, 0,
  443. NULL,
  444. 0, NULL},
  445. //
  446. // Transitive, trans
  447. //
  448. {MSG_TAG_TRANSITIVE, NULL,
  449. MSG_TAG_TRANSITIVE_SHORT, NULL,
  450. ARG_TYPE_STR, ARG_FLAG_DEFAULTABLE,
  451. (CMD_TYPE)L"",
  452. 0, NULL},
  453. //
  454. // OneSide, os
  455. //
  456. {MSG_TAG_ONESIDE, NULL,
  457. MSG_TAG_ONESIDE_SHORT, NULL,
  458. ARG_TYPE_STR, 0,
  459. NULL,
  460. 0, NULL},
  461. //
  462. // NameSuffixes, ns
  463. //
  464. {MSG_TAG_NAMESUFFIXES, NULL,
  465. MSG_TAG_NAMESUFFIX_SHORT, NULL,
  466. ARG_TYPE_STR, 0,
  467. NULL,
  468. 0, NULL},
  469. //
  470. // ToggleSuffix, ts
  471. //
  472. {MSG_TAG_TOGGLESUFFIX, NULL,
  473. MSG_TAG_TOGGLESUFFIX_SHORT, NULL,
  474. ARG_TYPE_STR, 0,
  475. NULL,
  476. 0, NULL},
  477. //
  478. // FilterSIDs
  479. //
  480. {MSG_TAG_FILTER_SIDS, NULL,
  481. ID_ARG2_NULL, NULL,
  482. ARG_TYPE_STR, ARG_FLAG_DEFAULTABLE,
  483. (CMD_TYPE)L"",
  484. 0, NULL},
  485. //
  486. // ComputerName switches.
  487. //
  488. //
  489. // MakePrimary, MP
  490. //
  491. {MSG_TAG_MAKEPRIMARY, NULL,
  492. MSG_TAG_MAKEPRIMARY_SHORT, NULL,
  493. ARG_TYPE_STR, 0,
  494. NULL,
  495. 0, NULL},
  496. //
  497. // Enumerate, Enum
  498. //
  499. {MSG_TAG_ENUM, NULL,
  500. MSG_TAG_ENUM_SHORT, NULL,
  501. ARG_TYPE_STR, ARG_FLAG_DEFAULTABLE,
  502. (CMD_TYPE)L"",
  503. 0, NULL},
  504. {ARG_TERMINATOR}
  505. };