~nabijaczleweli/voreutils

5fa9f51a486498e332ceef7eaec5bb55d66cf81d — наб 3 months ago 9914370
Clean up {sleep,hostid}.cpp
2 files changed, 4 insertions(+), 8 deletions(-)

M cmd/hostid.cpp
M cmd/sleep.cpp
M cmd/hostid.cpp => cmd/hostid.cpp +2 -4
@@ 8,10 8,8 @@


int main(int, const char * const * argv) {
	if(argv[0] && argv[1]) {
		std::fprintf(stderr, "usage: %s\n", argv[0]);
		return 1;
	}
	if(argv[0] && argv[1])
		return std::fprintf(stderr, "usage: %s\n", argv[0]), 1;

	std::fprintf(stdout, "%08" PRIx32 "\n", static_cast<std::uint32_t>(gethostid()));
	return vore::flush_stdout(argv[0]);

M cmd/sleep.cpp => cmd/sleep.cpp +2 -4
@@ 11,10 11,8 @@


int main(int, char * const * argv) {
	if(!argv[0] || !argv[1]) {
		std::fprintf(stderr, "usage: %s delay[smhdwy]...\n", argv[0]);
		return 1;
	}
	if(!argv[0] || !argv[1])
		return std::fprintf(stderr, "usage: %s delay[smhdwy]...\n", argv[0]), 1;

	for(auto val : vore::opt::args{argv + 1}) {
		auto tsl = vore::parse_duration(argv[0], val);