diff --git a/dastworx/src/main.d b/dastworx/src/main.d index 43ad4bb2..ff19ff7f 100644 --- a/dastworx/src/main.d +++ b/dastworx/src/main.d @@ -40,7 +40,7 @@ void main(string[] args) // even when files are passed, the std input has to be closed by the IDE foreach(ref buffer; stdin.byChunk(4096)) source.put(buffer); - if (!source.data.length) + if (!source.data.length && args.length > 1) { import std.file: exists; files = args[1].splitter(pathSeparator).filter!exists.array; @@ -82,7 +82,8 @@ void handleSymListOption() void handleTodosOption() { mixin(logCall); - getTodos(files); + if (files.length) + getTodos(files); } /// Handles the "-i" option: create the import list in the output diff --git a/src/ce_todolist.pas b/src/ce_todolist.pas index db2e65ac..21b23e32 100644 --- a/src/ce_todolist.pas +++ b/src/ce_todolist.pas @@ -420,8 +420,8 @@ begin ctxt := getContext; case ctxt of tcNone: exit; - tcProject: if fProj = nil then exit; - tcFile: if fProj = nil then exit; + tcProject: if (fProj = nil) or (fProj.sourcesCount = 0) then exit; + tcFile: if fDoc = nil then exit; end; if not exeInSysPath(ToolExeName) then exit;