From e913247fec162437920266182834aedadcb03004 Mon Sep 17 00:00:00 2001 From: Rob Landley Date: Tue, 31 Oct 2017 15:51:02 -0500 Subject: [PATCH] Rename test_*.c to demo_*.c (because "make test_$CMD" means something already), fluff out README, and add a comment to hostid explaining its deprecation. --- toys/example/README | 10 ++++++++++ .../{test_human_readable.c => demo_human_readable.c} | 0 .../{test_many_options.c => demo_many_options.c} | 0 toys/example/{test_scankey.c => demo_scankey.c} | 0 toys/example/{test_utf8towc.c => demo_utf8towc.c} | 0 toys/example/hostid.c | 3 +++ 6 files changed, 13 insertions(+) rename toys/example/{test_human_readable.c => demo_human_readable.c} (100%) rename toys/example/{test_many_options.c => demo_many_options.c} (100%) rename toys/example/{test_scankey.c => demo_scankey.c} (100%) rename toys/example/{test_utf8towc.c => demo_utf8towc.c} (100%) diff --git a/toys/example/README b/toys/example/README index d0f6631a..a3af8519 100644 --- a/toys/example/README +++ b/toys/example/README @@ -2,3 +2,13 @@ Example commands You probably don't want to deploy this, but it shows how to use the toybox infrastructure and provides templates for new commands. + +The hello.c and skeleton.c commands provide templates: hello.c is clean and +simple, skeleton.c demonstrates the option parsing infrastructure and having +multiple commands per file. When writing a new command, copying hello.c or +skeleton.c to the new name may provide a good starting point. + +The demo_* commands demonstrate infrastructure. + +Other commands in here are obsolete versions still in some recent Linux systems +(and often still in posix), but not really useful on modern systems. diff --git a/toys/example/test_human_readable.c b/toys/example/demo_human_readable.c similarity index 100% rename from toys/example/test_human_readable.c rename to toys/example/demo_human_readable.c diff --git a/toys/example/test_many_options.c b/toys/example/demo_many_options.c similarity index 100% rename from toys/example/test_many_options.c rename to toys/example/demo_many_options.c diff --git a/toys/example/test_scankey.c b/toys/example/demo_scankey.c similarity index 100% rename from toys/example/test_scankey.c rename to toys/example/demo_scankey.c diff --git a/toys/example/test_utf8towc.c b/toys/example/demo_utf8towc.c similarity index 100% rename from toys/example/test_utf8towc.c rename to toys/example/demo_utf8towc.c diff --git a/toys/example/hostid.c b/toys/example/hostid.c index feef61bf..3d7a8a8c 100644 --- a/toys/example/hostid.c +++ b/toys/example/hostid.c @@ -3,6 +3,9 @@ * Copyright 2015 Ranjan Kumar * * No Standard. + * + * This is still in coreutils and gethostid() in posix, but a "globally unique + * 32 bit identifier" is a concept the Linux world has outgrown. USE_HOSTID(NEWTOY(hostid, ">0", TOYFLAG_USR|TOYFLAG_BIN)) -- 2.39.2