Commit d1c34333 authored by Jonas Termansen's avatar Jonas Termansen

Add rw(1).

parent d393b67d
......@@ -22,6 +22,7 @@ kblayout-compiler \
login \
mkinitrd \
regress \
rw \
sf \
sh \
sysinstall \
......
include ../build-aux/platform.mak
include ../build-aux/compiler.mak
include ../build-aux/version.mak
include ../build-aux/dirs.mak
OPTLEVEL?=$(DEFAULT_OPTLEVEL)
CFLAGS?=$(OPTLEVEL)
CFLAGS += -Wall -Wextra
BINARIES = rw
MANPAGES1 = rw.1
all: $(BINARIES)
.PHONY: all install clean
install: all
mkdir -p $(DESTDIR)$(BINDIR)
install $(BINARIES) $(DESTDIR)$(BINDIR)
mkdir -p $(DESTDIR)$(MANDIR)/man1
cp $(MANPAGES1) $(DESTDIR)$(MANDIR)/man1
%: %.c
$(CC) -std=gnu11 $(CFLAGS) $(CPPFLAGS) $< -o $@
clean:
rm -f $(BINARIES)
This diff is collapsed.
This diff is collapsed.
......@@ -109,6 +109,12 @@ void suggest_reboot(const char* filename)
}
}
void suggest_rw(const char* filename)
{
fprintf(stderr, "No command '%s' found, did you mean:\n", filename);
fprintf(stderr, " Command 'rw' from package 'rw'\n");
}
int main(int argc, char* argv[])
{
const char* filename = 2 <= argc ? argv[1] : argv[0];
......@@ -134,6 +140,8 @@ int main(int argc, char* argv[])
suggest_poweroff(filename);
else if ( !strcmp(filename, "reboot") )
suggest_reboot(filename);
else if ( !strcmp(filename, "dd") )
suggest_rw(filename);
fprintf(stderr, "%s: command not found\n", filename);
return 127;
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment