Skip to content

Add Support for Reading Source Text From Standard Input#43

Merged
kilo52 merged 5 commits intomasterfrom
feature/read-stdin
Apr 18, 2026
Merged

Add Support for Reading Source Text From Standard Input#43
kilo52 merged 5 commits intomasterfrom
feature/read-stdin

Conversation

@kilo52
Copy link
Copy Markdown
Member

@kilo52 kilo52 commented Apr 12, 2026

Adds support in scount to specify via the '-' argument that the input should not be read from a file but rather taken from standard input. By providing an explicit extension '-.ext', the user can further specify that the provided source input should be treated as source formatted in a specific format or programming language.

Implemented functionality to read source text from stdin, allowing users to
specify input using '-' or '-.ext'. This implementation is kept rather simple,
effectively reading input from stdin and writing it into a temporary file. This
is done so that the path to the temporary file can be passed to the API
of the rcnCount() function. This avoids the need to introduce another API
function at this point, or to provide a quasi separate implementation of
rcnCount() in the scount code.

[CL]: Added support in scount for reading source input via stdin. [Issue#31]

Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
@kilo52 kilo52 self-assigned this Apr 12, 2026
@kilo52 kilo52 added the Feature New feature label Apr 12, 2026
@kilo52 kilo52 linked an issue Apr 12, 2026 that may be closed by this pull request
kilo52 added 4 commits April 14, 2026 21:32
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
…s invalid.

Signed-off-by: Phil Gaiser <phil.gaiser@raven-computing.com>
@kilo52
Copy link
Copy Markdown
Member Author

kilo52 commented Apr 17, 2026

Implementation in input.c is very ugly and needs to be rewritten once an API for manual stats construction is available. See #48

@kilo52 kilo52 merged commit a10f695 into master Apr 18, 2026
22 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Feature New feature

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Support for Reading Source Files From Standard Input

1 participant