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.

43 lines
771 B

  1. @if "%_echo%" == "" echo off
  2. if "%1" == "" goto usage
  3. if "%1" == "-?" goto usage
  4. if "%1" == "/?" goto usage
  5. setlocal
  6. goto %1
  7. :usage
  8. echo Usage: WHATS [extra OR missing OR diff]
  9. goto :eof
  10. rem
  11. rem Report on files that are different from the SD version
  12. rem
  13. :diff
  14. sd diff -sE *
  15. goto :eof
  16. rem
  17. rem Report on files that are missing or extra from the SD version
  18. rem
  19. :missing
  20. :extra
  21. (for /f "tokens=3" %%i in ('sd have *') do @(
  22. echo %%~pnxi
  23. )) | sort > %tmp%\whats-server.txt
  24. (for %%i in (*) do @(
  25. echo %%~pnxi
  26. )) | sort > %tmp%\whats-local.txt
  27. if "%1" == "missing" (diff %tmp%\whats-server.txt %tmp%\whats-local.txt | trans /t "^< {?*}$" "$1")
  28. if "%1" == "extra" (diff %tmp%\whats-server.txt %tmp%\whats-local.txt | trans /t "^> {?*}$" "$1")
  29. endlocal