Document --search option in readme and add version number option
This commit is contained in:
parent
f9e93b096a
commit
9434629416
32
README.md
32
README.md
|
@ -31,8 +31,8 @@ issue.
|
||||||
* Display of documentation comments in function call tips
|
* Display of documentation comments in function call tips
|
||||||
* *alias this*
|
* *alias this*
|
||||||
* *auto* declarations (Mostly)
|
* *auto* declarations (Mostly)
|
||||||
|
* *with* statements
|
||||||
* Not working:
|
* Not working:
|
||||||
* Automatic starting of the server by the client
|
|
||||||
* UFCS suggestions
|
* UFCS suggestions
|
||||||
* Autocompletion of declarations with template arguments (This will work to some extent, but it won't do things like replace T with int)
|
* Autocompletion of declarations with template arguments (This will work to some extent, but it won't do things like replace T with int)
|
||||||
* Determining the type of an enum member when no base type is specified, but the first member has an initialaizer
|
* Determining the type of an enum member when no base type is specified, but the first member has an initialaizer
|
||||||
|
@ -149,6 +149,36 @@ followed by the byte offset, followed by a newline character. For example:
|
||||||
|
|
||||||
/home/example/src/project/bar.d 3482
|
/home/example/src/project/bar.d 3482
|
||||||
|
|
||||||
|
## Search for symbols by name
|
||||||
|
|
||||||
|
The "--search" or "-s" option causes the server to return location information
|
||||||
|
for all symbols with the given name in both the file being edited as well as
|
||||||
|
the server cache. The output format is one result per line, with the path, the
|
||||||
|
symbol type, and the byte offset of the symbol separated by tab characters.
|
||||||
|
|
||||||
|
### Example
|
||||||
|
|
||||||
|
Search the server's cache for symbols named "toImpl". (Using echo to give an EOF
|
||||||
|
in place of a file being edited.)
|
||||||
|
```echo | dcd-client --search toImpl``
|
||||||
|
|
||||||
|
```
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 48491
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 47527
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 47229
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 40358
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 38348
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 35619
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 32743
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 22486
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 16322
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 14829
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 14066
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 13058
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 12717
|
||||||
|
/usr/include/dmd/phobos/std/conv.d f 9494
|
||||||
|
```
|
||||||
|
|
||||||
#Server
|
#Server
|
||||||
The server must be running for the DCD client to provide autocomplete information.
|
The server must be running for the DCD client to provide autocomplete information.
|
||||||
In future versions the client may start the server if it is not running, but for
|
In future versions the client may start the server if it is not running, but for
|
||||||
|
|
2
makefile
2
makefile
|
@ -21,6 +21,7 @@ clean:
|
||||||
CLIENT_SRC = src/client.d\
|
CLIENT_SRC = src/client.d\
|
||||||
src/messages.d\
|
src/messages.d\
|
||||||
src/stupidlog.d\
|
src/stupidlog.d\
|
||||||
|
src/dcd_version.d\
|
||||||
msgpack-d/src/msgpack.d
|
msgpack-d/src/msgpack.d
|
||||||
|
|
||||||
DMD_CLIENT_FLAGS = -Imsgpack-d/src\
|
DMD_CLIENT_FLAGS = -Imsgpack-d/src\
|
||||||
|
@ -57,6 +58,7 @@ SERVER_SRC = src/actypes.d\
|
||||||
src/server.d\
|
src/server.d\
|
||||||
src/stupidlog.d\
|
src/stupidlog.d\
|
||||||
src/string_interning.d\
|
src/string_interning.d\
|
||||||
|
src/dcd_version.d\
|
||||||
libdparse/src/std/d/ast.d\
|
libdparse/src/std/d/ast.d\
|
||||||
libdparse/src/std/d/entities.d\
|
libdparse/src/std/d/entities.d\
|
||||||
libdparse/src/std/d/lexer.d\
|
libdparse/src/std/d/lexer.d\
|
||||||
|
|
16
src/client.d
16
src/client.d
|
@ -32,6 +32,7 @@ import std.string;
|
||||||
import msgpack;
|
import msgpack;
|
||||||
import messages;
|
import messages;
|
||||||
import stupidlog;
|
import stupidlog;
|
||||||
|
import dcd_version;
|
||||||
|
|
||||||
int main(string[] args)
|
int main(string[] args)
|
||||||
{
|
{
|
||||||
|
@ -44,6 +45,7 @@ int main(string[] args)
|
||||||
bool symbolLocation;
|
bool symbolLocation;
|
||||||
bool doc;
|
bool doc;
|
||||||
bool query;
|
bool query;
|
||||||
|
bool printVersion;
|
||||||
string search;
|
string search;
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -51,7 +53,8 @@ int main(string[] args)
|
||||||
getopt(args, "cursorPos|c", &cursorPos, "I", &importPaths,
|
getopt(args, "cursorPos|c", &cursorPos, "I", &importPaths,
|
||||||
"port|p", &port, "help|h", &help, "shutdown", &shutdown,
|
"port|p", &port, "help|h", &help, "shutdown", &shutdown,
|
||||||
"clearCache", &clearCache, "symbolLocation|l", &symbolLocation,
|
"clearCache", &clearCache, "symbolLocation|l", &symbolLocation,
|
||||||
"doc|d", &doc, "query|q", &query, "search|s", &search);
|
"doc|d", &doc, "query|q", &query, "search|s", &search,
|
||||||
|
"version", &printVersion);
|
||||||
}
|
}
|
||||||
catch (Exception e)
|
catch (Exception e)
|
||||||
{
|
{
|
||||||
|
@ -61,7 +64,13 @@ int main(string[] args)
|
||||||
|
|
||||||
AutocompleteRequest request;
|
AutocompleteRequest request;
|
||||||
|
|
||||||
if (help)
|
|
||||||
|
if (printVersion)
|
||||||
|
{
|
||||||
|
writeln(DCD_VERSION);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
else if (help)
|
||||||
{
|
{
|
||||||
printHelp(args[0]);
|
printHelp(args[0]);
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -231,6 +240,9 @@ Options:
|
||||||
Instructs the server to add PATH to its list of paths searced for
|
Instructs the server to add PATH to its list of paths searced for
|
||||||
imported modules.
|
imported modules.
|
||||||
|
|
||||||
|
--version
|
||||||
|
Prints the version number and then exits.
|
||||||
|
|
||||||
--port PORTNUMBER | -p PORTNUMBER
|
--port PORTNUMBER | -p PORTNUMBER
|
||||||
Uses PORTNUMBER to communicate with the server instead of the default
|
Uses PORTNUMBER to communicate with the server instead of the default
|
||||||
port 9166.`, programName);
|
port 9166.`, programName);
|
||||||
|
|
|
@ -0,0 +1,21 @@
|
||||||
|
/**
|
||||||
|
* This file is part of DCD, a development tool for the D programming language.
|
||||||
|
* Copyright (C) 2014 Brian Schott
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
module dcd_version;
|
||||||
|
|
||||||
|
enum DCD_VERSION = "v0.4.0-beta2";
|
22
src/server.d
22
src/server.d
|
@ -40,6 +40,7 @@ import modulecache;
|
||||||
import stupidlog;
|
import stupidlog;
|
||||||
import actypes;
|
import actypes;
|
||||||
import core.memory;
|
import core.memory;
|
||||||
|
import dcd_version;
|
||||||
|
|
||||||
enum CONFIG_FILE_NAME = "dcd.conf";
|
enum CONFIG_FILE_NAME = "dcd.conf";
|
||||||
|
|
||||||
|
@ -58,11 +59,13 @@ int main(string[] args)
|
||||||
|
|
||||||
ushort port = 9166;
|
ushort port = 9166;
|
||||||
bool help;
|
bool help;
|
||||||
|
bool printVersion;
|
||||||
string[] importPaths;
|
string[] importPaths;
|
||||||
|
|
||||||
try
|
try
|
||||||
{
|
{
|
||||||
getopt(args, "port|p", &port, "I", &importPaths, "help|h", &help);
|
getopt(args, "port|p", &port, "I", &importPaths, "help|h", &help,
|
||||||
|
"version", & printVersion);
|
||||||
}
|
}
|
||||||
catch (ConvException e)
|
catch (ConvException e)
|
||||||
{
|
{
|
||||||
|
@ -71,6 +74,12 @@ int main(string[] args)
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (printVersion)
|
||||||
|
{
|
||||||
|
writeln(DCD_VERSION);
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
if (help)
|
if (help)
|
||||||
{
|
{
|
||||||
printHelp(args[0]);
|
printHelp(args[0]);
|
||||||
|
@ -277,8 +286,15 @@ void printHelp(string programName)
|
||||||
Usage: %s options
|
Usage: %s options
|
||||||
|
|
||||||
options:
|
options:
|
||||||
-I path
|
-I PATH
|
||||||
Includes path in the listing of paths that are searched for file imports
|
Includes PATH in the listing of paths that are searched for file
|
||||||
|
imports.
|
||||||
|
|
||||||
|
--help | -h
|
||||||
|
Prints this help message.
|
||||||
|
|
||||||
|
--version
|
||||||
|
Prints the version number and then exits.
|
||||||
|
|
||||||
--port PORTNUMBER | -pPORTNUMBER
|
--port PORTNUMBER | -pPORTNUMBER
|
||||||
Listens on PORTNUMBER instead of the default port 9166.`, programName);
|
Listens on PORTNUMBER instead of the default port 9166.`, programName);
|
||||||
|
|
Loading…
Reference in New Issue