AUTOMATE(1) General Commands Manual AUTOMATE(1)

automateA declarative frontend for redo

automate [-s sets] file redo-arg-1 redo-arg-2 redo-arg-3

The automate utility processes a rule from the specified file and acts as a venus-conf(1) frontend for redo(1). It must be invoked through redo(1), with the file encoded in venus-conf(5) format.

The automate utility performs the following steps:

1.
Selects a rule.
2.
Invokes redo-ifchange(1) for each dependency.
3.
Executes the specified module.
4.
Executes the specified command.

The rule is chosen using redo-arg-1 and the redo-whichdo(1) search pattern.

The following key entries have special meaning:

input
Set the input file (default: standard input)
module
Set the module to run (default: none)
output
Set the output file (default: standard output)
command
Set the command to run (default: true(1))

Any other key not used by a module is ignored. The value entries are interpreted as dependencies.

The following variables have special meaning:

1
Represents redo-arg-1.
2
Represents redo-arg-2.
3
Represents redo-arg-3.
@
Represents the rule dependencies.

The modules are executables files that processes its invoking block and performs specific operations.

The sets are files containing rules.

sets
Include the specified sets, separated by commas.

The directory path containing automate's config files and data.

/etc/automate/sets
A directory with rules files.
/etc/automate/modules
A directory with executable modules.

The automate utility exits 0 on success, and >0 if an error occurs.

Create a file named “default.do”:

#!/usr/bin/automate
program:hello
hello.c{
	output:$3
	module:heredoc
	heredoc{
		#include <stdio.h>
		int
		main(void) {
			puts("Hello, World!");
			return 0;
		}
	}
}

Build the program:

$ redo hello

redo(1), redo-whichdo(1), venus-conf(5)

October 8, 2024 EltaninOS