From c04b77ba82192e1489913bd25373920f913e8259 Mon Sep 17 00:00:00 2001 From: ivan tkachenko Date: Mon, 20 Feb 2023 17:00:05 +0300 Subject: [PATCH] Update arguments for file() command's synopsis Just went though the whole documentation page, copying all the uppercase keywords one by one, section by section. Common options are factored out the top of the list. --- CMakeCommands.sublime-syntax | 286 ++++++++++++++++++++++++++++------- CMakeCommands.yml | 117 +++++++++++++- 2 files changed, 341 insertions(+), 62 deletions(-) diff --git a/CMakeCommands.sublime-syntax b/CMakeCommands.sublime-syntax index 25aabf1..2dbb692 100644 --- a/CMakeCommands.sublime-syntax +++ b/CMakeCommands.sublime-syntax @@ -478,10 +478,28 @@ contexts: - include: scope:source.cmake#args-common file-args: - meta_scope: meta.function-call.arguments.cmake - - match: \bWRITE\b - scope: variable.parameter.WRITE.cmake - - match: \bAPPEND\b - scope: variable.parameter.APPEND.cmake + - match: \bNO_SOURCE_PERMISSIONS\b + scope: variable.parameter.NO_SOURCE_PERMISSIONS.cmake + - match: \bUSE_SOURCE_PERMISSIONS\b + scope: variable.parameter.USE_SOURCE_PERMISSIONS.cmake + - match: \bPERMISSIONS\b + scope: variable.parameter.PERMISSIONS.cmake + - match: \bFILE_PERMISSIONS\b + scope: variable.parameter.FILE_PERMISSIONS.cmake + - match: \bDIRECTORY_PERMISSIONS\b + scope: variable.parameter.DIRECTORY_PERMISSIONS.cmake + - match: \bREGEX\b + scope: variable.parameter.REGEX.cmake + - match: \bTIMEOUT\b + scope: variable.parameter.TIMEOUT.cmake + - match: \bINPUT\b + scope: variable.parameter.INPUT.cmake + - match: \bOUTPUT\b + scope: variable.parameter.OUTPUT.cmake + - match: \bDESTINATION\b + scope: variable.parameter.DESTINATION.cmake + - match: \bVERBOSE\b + scope: variable.parameter.VERBOSE.cmake - match: \bREAD\b scope: variable.parameter.READ.cmake - match: \bOFFSET\b @@ -492,74 +510,212 @@ contexts: scope: variable.parameter.HEX.cmake - match: \bSTRINGS\b scope: variable.parameter.STRINGS.cmake - - match: \bHASH\b - scope: variable.parameter.HASH.cmake + - match: \bLENGTH_MAXIMUM\b + scope: variable.parameter.LENGTH_MAXIMUM.cmake + - match: \bLENGTH_MINIMUM\b + scope: variable.parameter.LENGTH_MINIMUM.cmake + - match: \bLIMIT_COUNT\b + scope: variable.parameter.LIMIT_COUNT.cmake + - match: \bLIMIT_INPUT\b + scope: variable.parameter.LIMIT_INPUT.cmake + - match: \bLIMIT_OUTPUT\b + scope: variable.parameter.LIMIT_OUTPUT.cmake + - match: \bNEWLINE_CONSUME\b + scope: variable.parameter.NEWLINE_CONSUME.cmake + - match: \bNO_HEX_CONVERSION\b + scope: variable.parameter.NO_HEX_CONVERSION.cmake + - match: \bENCODING\b + scope: variable.parameter.ENCODING.cmake + - match: \bMD5\b + scope: variable.parameter.MD5.cmake + - match: \bSHA1\b + scope: variable.parameter.SHA1.cmake + - match: \bSHA224\b + scope: variable.parameter.SHA224.cmake + - match: \bSHA256\b + scope: variable.parameter.SHA256.cmake + - match: \bSHA384\b + scope: variable.parameter.SHA384.cmake + - match: \bSHA512\b + scope: variable.parameter.SHA512.cmake + - match: \bSHA3_224\b + scope: variable.parameter.SHA3_224.cmake + - match: \bSHA3_256\b + scope: variable.parameter.SHA3_256.cmake + - match: \bSHA3_384\b + scope: variable.parameter.SHA3_384.cmake + - match: \bSHA3_512\b + scope: variable.parameter.SHA3_512.cmake + - match: \bTIMESTAMP\b + scope: variable.parameter.TIMESTAMP.cmake + - match: \bUTC\b + scope: variable.parameter.UTC.cmake + - match: \bGET_RUNTIME_DEPENDENCIES\b + scope: variable.parameter.GET_RUNTIME_DEPENDENCIES.cmake + - match: \bRESOLVED_DEPENDENCIES_VAR\b + scope: variable.parameter.RESOLVED_DEPENDENCIES_VAR.cmake + - match: \bUNRESOLVED_DEPENDENCIES_VAR\b + scope: variable.parameter.UNRESOLVED_DEPENDENCIES_VAR.cmake + - match: \bCONFLICTING_DEPENDENCIES_PREFIX\b + scope: variable.parameter.CONFLICTING_DEPENDENCIES_PREFIX.cmake + - match: \bEXECUTABLES\b + scope: variable.parameter.EXECUTABLES.cmake + - match: \bLIBRARIES\b + scope: variable.parameter.LIBRARIES.cmake + - match: \bMODULES\b + scope: variable.parameter.MODULES.cmake + - match: \bDIRECTORIES\b + scope: variable.parameter.DIRECTORIES.cmake + - match: \bBUNDLE_EXECUTABLE\b + scope: variable.parameter.BUNDLE_EXECUTABLE.cmake + - match: \bPRE_INCLUDE_REGEXES\b + scope: variable.parameter.PRE_INCLUDE_REGEXES.cmake + - match: \bPRE_EXCLUDE_REGEXES\b + scope: variable.parameter.PRE_EXCLUDE_REGEXES.cmake + - match: \bPOST_INCLUDE_REGEXES\b + scope: variable.parameter.POST_INCLUDE_REGEXES.cmake + - match: \bPOST_EXCLUDE_REGEXES\b + scope: variable.parameter.POST_EXCLUDE_REGEXES.cmake + - match: \bPOST_INCLUDE_FILES\b + scope: variable.parameter.POST_INCLUDE_FILES.cmake + - match: \bPOST_EXCLUDE_FILES\b + scope: variable.parameter.POST_EXCLUDE_FILES.cmake + - match: \bWRITE\b + scope: variable.parameter.WRITE.cmake + - match: \bAPPEND\b + scope: variable.parameter.APPEND.cmake + - match: \bTOUCH\b + scope: variable.parameter.TOUCH.cmake + - match: \bTOUCH_NOCREATE\b + scope: variable.parameter.TOUCH_NOCREATE.cmake + - match: \bGENERATE\b + scope: variable.parameter.GENERATE.cmake + - match: \bCONDITION\b + scope: variable.parameter.CONDITION.cmake + - match: \bTARGET\b + scope: variable.parameter.TARGET.cmake + - match: \bCONFIGURE\b + scope: variable.parameter.CONFIGURE.cmake + - match: \bESCAPE_QUOTES\b + scope: variable.parameter.ESCAPE_QUOTES.cmake + - match: \b@ONLY\b + scope: variable.parameter.@ONLY.cmake + - match: \bNEWLINE_STYLE\b + scope: variable.parameter.NEWLINE_STYLE.cmake + - match: \bUNIX\b + scope: variable.parameter.UNIX.cmake + - match: \bDOS\b + scope: variable.parameter.DOS.cmake + - match: \bWIN32\b + scope: variable.parameter.WIN32.cmake + - match: \bLF\b + scope: variable.parameter.LF.cmake + - match: \bCRLF\b + scope: variable.parameter.CRLF.cmake + - match: \bCONTENT\b + scope: variable.parameter.CONTENT.cmake - match: \bGLOB\b scope: variable.parameter.GLOB.cmake - - match: \bLIST_DIRECTORIES\b - scope: variable.parameter.LIST_DIRECTORIES.cmake - - match: \bRELATIVE\b - scope: variable.parameter.RELATIVE.cmake - match: \bGLOB_RECURSE\b scope: variable.parameter.GLOB_RECURSE.cmake - match: \bFOLLOW_SYMLINKS\b scope: variable.parameter.FOLLOW_SYMLINKS.cmake - - match: \bRENAME\b - scope: variable.parameter.RENAME.cmake + - match: \bLIST_DIRECTORIES\b + scope: variable.parameter.LIST_DIRECTORIES.cmake + - match: \bRELATIVE\b + scope: variable.parameter.RELATIVE.cmake + - match: \bCONFIGURE_DEPENDS\b + scope: variable.parameter.CONFIGURE_DEPENDS.cmake + - match: \bMAKE_DIRECTORY\b + scope: variable.parameter.MAKE_DIRECTORY.cmake - match: \bREMOVE\b scope: variable.parameter.REMOVE.cmake - match: \bREMOVE_RECURSE\b scope: variable.parameter.REMOVE_RECURSE.cmake - - match: \bMAKE_DIRECTORY\b - scope: variable.parameter.MAKE_DIRECTORY.cmake - - match: \bRELATIVE_PATH\b - scope: variable.parameter.RELATIVE_PATH.cmake - - match: \bTO_CMAKE_PATH\b - scope: variable.parameter.TO_CMAKE_PATH.cmake - - match: \bTO_NATIVE_PATH\b - scope: variable.parameter.TO_NATIVE_PATH.cmake - - match: \bDOWNLOAD\b - scope: variable.parameter.DOWNLOAD.cmake - - match: \bUPLOAD\b - scope: variable.parameter.UPLOAD.cmake - - match: \bTIMESTAMP\b - scope: variable.parameter.TIMESTAMP.cmake - - match: \bUTC\b - scope: variable.parameter.UTC.cmake - - match: \bGENERATE\b - scope: variable.parameter.GENERATE.cmake - - match: \bOUTPUT\b - scope: variable.parameter.OUTPUT.cmake - - match: \bINPUT\b - scope: variable.parameter.INPUT.cmake - - match: \bCONTENT\b - scope: variable.parameter.CONTENT.cmake - - match: \bCONDITION\b - scope: variable.parameter.CONDITION.cmake + - match: \bRENAME\b + scope: variable.parameter.RENAME.cmake + - match: \bNO_REPLACE\b + scope: variable.parameter.NO_REPLACE.cmake + - match: \bCOPY_FILE\b + scope: variable.parameter.COPY_FILE.cmake + - match: \bONLY_IF_DIFFERENT\b + scope: variable.parameter.ONLY_IF_DIFFERENT.cmake + - match: \bRESULT\b + scope: variable.parameter.RESULT.cmake - match: \bCOPY\b scope: variable.parameter.COPY.cmake - match: \bINSTALL\b scope: variable.parameter.INSTALL.cmake - - match: \bDESTINATION\b - scope: variable.parameter.DESTINATION.cmake - - match: \bFILE_PERMISSIONS\b - scope: variable.parameter.FILE_PERMISSIONS.cmake - - match: \bDIRECTORY_PERMISSIONS\b - scope: variable.parameter.DIRECTORY_PERMISSIONS.cmake - - match: \bNO_SOURCE_PERMISSIONS\b - scope: variable.parameter.NO_SOURCE_PERMISSIONS.cmake - - match: \bUSE_SOURCE_PERMISSIONS\b - scope: variable.parameter.USE_SOURCE_PERMISSIONS.cmake + - match: \bFOLLOW_SYMLINK_CHAIN\b + scope: variable.parameter.FOLLOW_SYMLINK_CHAIN.cmake - match: \bFILES_MATCHING\b scope: variable.parameter.FILES_MATCHING.cmake - match: \bPATTERN\b scope: variable.parameter.PATTERN.cmake - - match: \bREGEX\b - scope: variable.parameter.REGEX.cmake - match: \bEXCLUDE\b scope: variable.parameter.EXCLUDE.cmake - - match: \bPERMISSIONS\b - scope: variable.parameter.PERMISSIONS.cmake + - match: \bSIZE\b + scope: variable.parameter.SIZE.cmake + - match: \bREAD_SYMLINK\b + scope: variable.parameter.READ_SYMLINK.cmake + - match: \bCREATE_LINK\b + scope: variable.parameter.CREATE_LINK.cmake + - match: \bCOPY_ON_ERROR\b + scope: variable.parameter.COPY_ON_ERROR.cmake + - match: \bSYMBOLIC\b + scope: variable.parameter.SYMBOLIC.cmake + - match: \bCHMOD\b + scope: variable.parameter.CHMOD.cmake + - match: \bCHMOD_RECURSE\b + scope: variable.parameter.CHMOD_RECURSE.cmake + - match: \bREAL_PATH\b + scope: variable.parameter.REAL_PATH.cmake + - match: \bBASE_DIRECTORY\b + scope: variable.parameter.BASE_DIRECTORY.cmake + - match: \bEXPAND_TILDE\b + scope: variable.parameter.EXPAND_TILDE.cmake + - match: \bRELATIVE_PATH\b + scope: variable.parameter.RELATIVE_PATH.cmake + - match: \bTO_CMAKE_PATH\b + scope: variable.parameter.TO_CMAKE_PATH.cmake + - match: \bTO_NATIVE_PATH\b + scope: variable.parameter.TO_NATIVE_PATH.cmake + - match: \bDOWNLOAD\b + scope: variable.parameter.DOWNLOAD.cmake + - match: \bUPLOAD\b + scope: variable.parameter.UPLOAD.cmake + - match: \bINACTIVITY_TIMEOUT\b + scope: variable.parameter.INACTIVITY_TIMEOUT.cmake + - match: \bLOG\b + scope: variable.parameter.LOG.cmake + - match: \bSHOW_PROGRESS\b + scope: variable.parameter.SHOW_PROGRESS.cmake + - match: \bSTATUS\b + scope: variable.parameter.STATUS.cmake + - match: \bUSERPWD\b + scope: variable.parameter.USERPWD.cmake + - match: \bHTTPHEADER\b + scope: variable.parameter.HTTPHEADER.cmake + - match: \bNETRC\b + scope: variable.parameter.NETRC.cmake + - match: \bIGNORED\b + scope: variable.parameter.IGNORED.cmake + - match: \bOPTIONAL\b + scope: variable.parameter.OPTIONAL.cmake + - match: \bREQUIRED\b + scope: variable.parameter.REQUIRED.cmake + - match: \bTLS_VERIFY\b + scope: variable.parameter.TLS_VERIFY.cmake + - match: \bTLS_CAINFO\b + scope: variable.parameter.TLS_CAINFO.cmake + - match: \bEXPECTED_HASH\b + scope: variable.parameter.EXPECTED_HASH.cmake + - match: \bEXPECTED_MD5\b + scope: variable.parameter.EXPECTED_MD5.cmake + - match: \bRANGE_START\b + scope: variable.parameter.RANGE_START.cmake + - match: \bRANGE_END\b + scope: variable.parameter.RANGE_END.cmake - match: \bLOCK\b scope: variable.parameter.LOCK.cmake - match: \bDIRECTORY\b @@ -568,10 +724,32 @@ contexts: scope: variable.parameter.RELEASE.cmake - match: \bGUARD\b scope: variable.parameter.GUARD.cmake + - match: \bFUNCTION\b + scope: variable.parameter.FUNCTION.cmake + - match: \bFILE\b + scope: variable.parameter.FILE.cmake + - match: \bPROCESS\b + scope: variable.parameter.PROCESS.cmake - match: \bRESULT_VARIABLE\b scope: variable.parameter.RESULT_VARIABLE.cmake - - match: \bTIMEOUT\b - scope: variable.parameter.TIMEOUT.cmake + - match: \bARCHIVE_CREATE\b + scope: variable.parameter.ARCHIVE_CREATE.cmake + - match: \bPATHS\b + scope: variable.parameter.PATHS.cmake + - match: \bFORMAT\b + scope: variable.parameter.FORMAT.cmake + - match: \bCOMPRESSION\b + scope: variable.parameter.COMPRESSION.cmake + - match: \bCOMPRESSION_LEVEL\b + scope: variable.parameter.COMPRESSION_LEVEL.cmake + - match: \bMTIME\b + scope: variable.parameter.MTIME.cmake + - match: \bARCHIVE_EXTRACT\b + scope: variable.parameter.ARCHIVE_EXTRACT.cmake + - match: \bPATTERNS\b + scope: variable.parameter.PATTERNS.cmake + - match: \bLIST_ONLY\b + scope: variable.parameter.LIST_ONLY.cmake - include: scope:source.cmake#args-common find_file-args: - meta_scope: meta.function-call.arguments.cmake diff --git a/CMakeCommands.yml b/CMakeCommands.yml index 572ad76..7d12774 100644 --- a/CMakeCommands.yml +++ b/CMakeCommands.yml @@ -47,14 +47,115 @@ exec_program: [ARGS, OUTPUT_VARIABLE, RETURN_VALUE] # deprecated execute_process: [COMMAND, WORKING_DIRECTORY, TIMEOUT, RESULT_VARIABLE, OUTPUT_VARIABLE, ERROR_VARIABLE, INPUT_FILE, OUTPUT_FILE, ERROR_FILE, OUTPUT_QUIET, ERROR_QUIET, OUTPUT_STRIP_TRAILING_WHITESPACE, ERROR_STRIP_TRAILING_WHITESPACE, ENCODING] export: [EXPORT, NAMESPACE, FILE, TARGETS, APPEND, EXPORT_LINK_INTERFACE_LIBRARIES, PACKAGE, ANDROID_MK] export_library_dependencies: [APPEND] -file: [WRITE, APPEND, READ, OFFSET, LIMIT, HEX, STRINGS, HASH, GLOB, - LIST_DIRECTORIES, RELATIVE, GLOB_RECURSE, FOLLOW_SYMLINKS, RENAME, REMOVE, - REMOVE_RECURSE, MAKE_DIRECTORY, RELATIVE_PATH, TO_CMAKE_PATH, TO_NATIVE_PATH, - DOWNLOAD, UPLOAD, TIMESTAMP, UTC, GENERATE, OUTPUT, INPUT, CONTENT, CONDITION, - COPY, INSTALL, DESTINATION, FILE_PERMISSIONS, DIRECTORY_PERMISSIONS, - NO_SOURCE_PERMISSIONS, USE_SOURCE_PERMISSIONS, FILES_MATCHING, PATTERN, REGEX, - EXCLUDE, PERMISSIONS, LOCK, DIRECTORY, RELEASE, GUARD, RESULT_VARIABLE, - TIMEOUT] +file: [ + ### Common options ### + + # permissions-related + NO_SOURCE_PERMISSIONS, USE_SOURCE_PERMISSIONS, PERMISSIONS, + FILE_PERMISSIONS, DIRECTORY_PERMISSIONS, + + # other + REGEX, TIMEOUT, INPUT, OUTPUT, DESTINATION, VERBOSE, + + ### Reading ### + + READ, OFFSET, LIMIT, HEX, + + STRINGS, LENGTH_MAXIMUM, LENGTH_MINIMUM, LIMIT_COUNT, LIMIT_INPUT, + LIMIT_OUTPUT, NEWLINE_CONSUME, NO_HEX_CONVERSION, ENCODING, + # REGEX is defined in common options. + + # + MD5, SHA1, SHA224, SHA256, SHA384, SHA512, SHA3_224, SHA3_256, SHA3_384, + SHA3_512, + + TIMESTAMP, UTC, + + GET_RUNTIME_DEPENDENCIES, RESOLVED_DEPENDENCIES_VAR, + UNRESOLVED_DEPENDENCIES_VAR, CONFLICTING_DEPENDENCIES_PREFIX, EXECUTABLES, + LIBRARIES, MODULES, DIRECTORIES, BUNDLE_EXECUTABLE, PRE_INCLUDE_REGEXES, + PRE_EXCLUDE_REGEXES, POST_INCLUDE_REGEXES, POST_EXCLUDE_REGEXES, + POST_INCLUDE_FILES, POST_EXCLUDE_FILES, + + ### Writing ### + + WRITE, APPEND, + + TOUCH, TOUCH_NOCREATE, + + GENERATE, CONDITION, TARGET, + # Defined in common options: + # NO_SOURCE_PERMISSIONS, USE_SOURCE_PERMISSIONS, FILE_PERMISSIONS, INPUT + + CONFIGURE, ESCAPE_QUOTES, "@ONLY", + + # Common for GENERATE & CONFIGURE: + NEWLINE_STYLE, UNIX, DOS, WIN32, LF, CRLF, CONTENT, + # OUTPUT is defined in common options + + ### Filesystem ### + + GLOB, GLOB_RECURSE, FOLLOW_SYMLINKS, + + # Common for GLOB & GLOB_RECURSE: + LIST_DIRECTORIES, RELATIVE, CONFIGURE_DEPENDS, + + MAKE_DIRECTORY, REMOVE, REMOVE_RECURSE, + + RENAME, NO_REPLACE, + + COPY_FILE, ONLY_IF_DIFFERENT, + + # Common for RENAME, COPY_FILE & CREATE_LINK: + RESULT, + + COPY, INSTALL, FOLLOW_SYMLINK_CHAIN, FILES_MATCHING, PATTERN, + EXCLUDE, + # REGEX is defined in STRINGS options. + # Defined in common options: DESTINATION, + # NO_SOURCE_PERMISSIONS, USE_SOURCE_PERMISSIONS, PERMISSIONS, FILE_PERMISSIONS, DIRECTORY_PERMISSIONS + + SIZE, READ_SYMLINK, + + CREATE_LINK, COPY_ON_ERROR, SYMBOLIC, + # RESULT is defined above + + CHMOD, CHMOD_RECURSE, + # Defined in common options: + # PERMISSIONS, FILE_PERMISSIONS, DIRECTORY_PERMISSIONS + + ### Path Conversion ### + + REAL_PATH, BASE_DIRECTORY, EXPAND_TILDE, + + RELATIVE_PATH, TO_CMAKE_PATH, TO_NATIVE_PATH, + + ### Transfer ### + + DOWNLOAD, UPLOAD, + + # Common transfer options: + INACTIVITY_TIMEOUT, LOG, SHOW_PROGRESS, STATUS, USERPWD, HTTPHEADER, NETRC, + IGNORED, OPTIONAL, REQUIRED, TLS_VERIFY, TLS_CAINFO, EXPECTED_HASH, + EXPECTED_MD5, RANGE_START, RANGE_END, + # TIMEOUT is defined in common options + + ### Locking ### + + LOCK, DIRECTORY, RELEASE, GUARD, FUNCTION, FILE, PROCESS, RESULT_VARIABLE, + # TIMEOUT is defined in common options + + ### Archiving ### + + ARCHIVE_CREATE, PATHS, FORMAT, COMPRESSION, COMPRESSION_LEVEL, MTIME, + # Defined in common options: + # OUTPUT, VERBOSE + + ARCHIVE_EXTRACT, PATTERNS, LIST_ONLY + # Defined in common options: + # INPUT, DESTINATION, VERBOSE + # TOUCH is defined in its own section +] find_file: [NAMES, HINTS, PATHS, PATH_SUFFIXES, DOC, NO_DEFAULT_PATH, NO_CMAKE_ENVIRONMENT_PATH, NO_CMAKE_PATH, NO_SYSTEM_ENVIRONMENT_PATH, NO_CMAKE_SYSTEM_PATH, CMAKE_FIND_ROOT_PATH_BOTH, ONLY_CMAKE_FIND_ROOT_PATH, NO_CMAKE_FIND_ROOT_PATH] find_library: [NAMES, NAMES_PER_DIR, HINTS, PATHS, PATH_SUFFIXES, DOC, NO_DEFAULT_PATH, NO_CMAKE_ENVIRONMENT_PATH, NO_CMAKE_PATH, NO_SYSTEM_ENVIRONMENT_PATH, NO_CMAKE_SYSTEM_PATH, CMAKE_FIND_ROOT_PATH_BOTH, ONLY_CMAKE_FIND_ROOT_PATH, NO_CMAKE_FIND_ROOT_PATH] find_package: [EXACT, QUIET, REQUIRED, COMPONENTS, CONFIG, NO_MODULE, NO_POLICY_SCOPE, NAMES, CONFIGS, HINTS, PATHS, PATH_SUFFIXES, NO_DEFAULT_PATH, NO_CMAKE_ENVIRONMENT_PATH, NO_CMAKE_PATH, NO_SYSTEM_ENVIRONMENT_PATH, NO_CMAKE_PACKAGE_REGISTRY, NO_CMAKE_BUILDS_PATH, NO_CMAKE_SYSTEM_PATH, NO_CMAKE_SYSTEM_PACKAGE_REGISTRY, CMAKE_FIND_ROOT_PATH_BOTH, ONLY_CMAKE_FIND_ROOT_PATH, NO_CMAKE_FIND_ROOT_PATH]