mirror of
https://github.com/Mercury-Language/mercury.git
synced 2025-12-10 03:13:46 +00:00
New script to help add continuation marks to the ends of lines.
Estimated hours taken: 0.1 Branches: main tools/add_cont_lines: New script to help add continuation marks to the ends of lines. This is useful e.g. when converting C functions to macros.
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
README
|
||||
add_cont_lines
|
||||
alias_sync
|
||||
appears
|
||||
assemble
|
||||
|
||||
15
tools/add_cont_lines
Executable file
15
tools/add_cont_lines
Executable file
@@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
# This script add a backslash to the end of every line in its input.
|
||||
# The input can come either from a list of files named on the command line
|
||||
# or from standard input.
|
||||
#
|
||||
# This script assumes that there are no tabs in the input.
|
||||
|
||||
awk '
|
||||
{
|
||||
printf "%s", $0;
|
||||
for (i = length($0); i < 78; i++)
|
||||
printf " ";
|
||||
|
||||
printf "\\\n";
|
||||
}' "$@"
|
||||
Reference in New Issue
Block a user