~nabijaczleweli/voreutils

ref: cb91cf21c628ab3d5e42d89694d99fcca6c8efc8 voreutils/cmd/echo.cpp -rw-r--r-- 443 bytes
cb91cf21наб Add uname (and arch). Centralise spaced print a month ago
                                                                                
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
// SPDX-License-Identifier: 0BSD


#include <cstdio>
#include <cstring>
#include <errno.h>
#include <string_view>
#include <vore-optarg>
#include <vore-print>

using namespace std::literals;


int main(int, const char * const * argv) {
	const char * self = argv[0];
	if(*argv)
		++argv;

	bool newline = true;
	if(*argv && *argv == "-n"sv) {
		++argv;
		newline = false;
	}

	return vore::print_spaced(self, vore::opt::args{argv}, newline);
}