Downloads
Wiki
Build CodeLite
Devs
|
Main /
Codelite-cliAbout
UsageRun
The options are in the form of JSON object, see below for more details. APIlistList a directory content Syntax:
Options:
Example output: $bin/codelite-cli list '{"path":"/home/eran/devl/codelite/codelite-cli/build-debug"}' [{ "path": "/home/eran/devl/codelite/codelite-cli/build-debug/bin", "type": "dir" }, { "path": "/home/eran/devl/codelite/codelite-cli/build-debug/CMakeCache.txt", "type": "file" }, { "path": "/home/eran/devl/codelite/codelite-cli/build-debug/lib", "type": "dir" }, { "path": "/home/eran/devl/codelite/codelite-cli/build-debug/Makefile", "type": "file" }, { "path": "/home/eran/devl/codelite/codelite-cli/build-debug/compile_commands.json", "type": "file" }, { "path": "/home/eran/devl/codelite/codelite-cli/build-debug/CMakeFiles", "type": "dir" }, { "path": "/home/eran/devl/codelite/codelite-cli/build-debug/cmake_install.cmake", "type": "file" }] each entry in the output JSON array, is marked with the field findPerform a find-in-files operation on a folder Syntax:
Options:
Example: $bin/codelite-cli find '{"path":"/home/eran/devl/codelite/codelite-cli", "what":"HasFlag", "case":true, "word":true, "mask":"*.cpp;*.h"}' [{ "file": "/home/eran/devl/codelite/codelite-cli/csConfig.h", "line": 26, "col": 9, "pos": 404, "pattern": " bool HasFlag(eConfigOption flag) const { return m_flags & flag; }", "len": 7, "flags": 3, "columnInChars": 9, "lenInChars": 7 }, { "file": "/home/eran/devl/codelite/codelite-cli/csConfig.h", "line": 38, "col": 39, "pos": 909, "pattern": " bool IsPrettyJSON() const { return HasFlag(kPrettyJSON); }", "len": 7, "flags": 3, "columnInChars": 39, "lenInChars": 7 }, { "filesScanned": 38, "matchesFound": 2, "elapsed": 118, "failedFiles": [], "findWhat": "HasFlag", "replaceWith": "" }] The result is in the form of JSON array containing list of objects. The last entry in the output array is the search summary. parseParse all files in a folder recursively that matches the file mask provided Syntax:
Options:
This command does not produce an output. Instead, you should check exit code (this is always a good idea...) code-completeOffers code completion in a given location in a file Syntax:
Options:
Example: $codelite-cli code-complete '{"lang":"php", "path":"/home/eran/devl/test_php/test.php", "position":128, "symbols-path":"/tmp/test_php.db"}' [{ "type": "f", "file": "/home/eran/devl/test_php/test.php", "name": "foo", "fullname": "\\MyClass\\foo", "doc": "", "line": 4, "col": 0, "flags": 2, "returns": "", "signature": "()" }, { "type": "f", "file": "/home/eran/devl/test_php/test.php", "name": "bar", "fullname": "\\MyClass\\bar", "doc": "", "line": 5, "col": 0, "flags": 2, "returns": "", "signature": "()" }, { "type": "f", "file": "/home/eran/devl/test_php/test.php", "name": "baz", "fullname": "\\MyClass\\baz", "doc": "", "line": 6, "col": 0, "flags": 2, "returns": "", "signature": "()" }] This API returns list of possible code completion members. Output fields:
When the entry is of type 'function' ('f'), these are the possible flag values: // Function flags enum { kFunc_Public = (1 << 1), kFunc_Private = (1 << 2), kFunc_Protected = (1 << 3), kFunc_Final = (1 << 4), kFunc_Static = (1 << 5), kFunc_Abstract = (1 << 6), kFunc_ReturnReference = (1 << 7), }; When the entry is of type 'variable' ('v'), these are the possible values: enum { kVar_Public = (1 << 1), kVar_Private = (1 << 2), kVar_Protected = (1 << 3), kVar_Member = (1 << 4), kVar_Reference = (1 << 5), kVar_Const = (1 << 6), kVar_FunctionArg = (1 << 7), kVar_Static = (1 << 8), kVar_Define = (1 << 9), }; |