Class JoinFilesCommand
java.lang.Object
eu.svjatoslav.alyverkko_cli.commands.JoinFilesCommand
- All Implemented Interfaces:
Command
The JoinFilesCommand aggregates multiple files (optionally matching
a specific pattern) into a single file for AI processing, typically
in the mail directory.
Usage Example:
alyverkko-cli joinfiles -s /path/to/source -p "*.java" -t "my_topic" --edit
-
Field Summary
FieldsModifier and TypeFieldDescriptioneu.svjatoslav.commons.cli_helper.parameter_parser.parameter.NullOptionIf present, open the joined file using a text editor afterward.The pattern used to filter files for joining, e.g.eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.StringOptionPattern for matching files, such as "*.java".The base directory for recursion when joining files.eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.DirectoryOptionDirectory from which files will be joined.eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.StringOptionTopic name, used as the basis for the output file name. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidexecuteCommand(String[] cliArguments) Executes the command that joins files from a specified directory (matching an optional pattern) into one output file in the mail directory.
-
Field Details
-
sourceDirectoryOption
public eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.DirectoryOption sourceDirectoryOptionDirectory from which files will be joined. -
patternOption
public eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.StringOption patternOptionPattern for matching files, such as "*.java". -
topic
public eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.StringOption topicTopic name, used as the basis for the output file name. -
editOption
public eu.svjatoslav.commons.cli_helper.parameter_parser.parameter.NullOption editOptionIf present, open the joined file using a text editor afterward. -
sourceBaseDirectory
The base directory for recursion when joining files. -
fileNamePattern
The pattern used to filter files for joining, e.g. "*.java".
-
-
Constructor Details
-
JoinFilesCommand
public JoinFilesCommand()
-
-
Method Details
-
getCommandName
- Specified by:
getCommandNamein interfaceCommand- Returns:
- the name of this command, i.e., "joinfiles".
-
executeCommand
Executes the command that joins files from a specified directory (matching an optional pattern) into one output file in the mail directory. Optionally, it can open the output file in an editor.- Specified by:
executeCommandin interfaceCommand- Parameters:
cliArguments- the command-line arguments after "joinfiles".- Throws:
IOException- if any IO operations fail.
-