Mailing List Archive


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[tlug] Bad attitude Wednesday [C&C maybe]



Simon Cozens writes:

 > GNU, needless to say, does not.

You'd think that instead of having all the bogus conventionally-
required option cruft, GNU would have allowed you to write

--------------------------------------------------------------------------------
/*
GNU sync is free software.  That means that you can do with it
whatever His Imperial Richardness says you can do, and no more.
Fortunately, he's in a good mood today, you can use it anywhere you
like but not in proprietary and permissively licensed free software,
nor in non-GPL B&D-licensed software, nor in public domain software.
It's for your own good!

For legal details, see the GNU Grossly Protectionist License.

Remember, GNU's Not Unix!  Just look at our code, Dennis, Brian, and
Rob would never write anything like this!

This file comes with full warranty.  Void if open(2)ed.
*/

/*
gnu_source_name = "GNU sync";
gnu_program_version = "27.3.4";
gnu_short_usage = NULL;
gnu_long_usage = NULL;
*/
#include "bsd_sync.c"
--------------------------------------------------------------------------------

Then GCC would automagically run the gnu_system_info program on it,
extract those variables into a database.  There would be commands (not
options) help and version which would access the database, and
exit functions for command error conditions:

#include <stdio.h>

void gnu_fatal_usage_external (char *invocation, char *program, int code)
{
  char *usage = gnu_db_get_usage (program);
  gnu_fatal_usage_internal (invocation, usage, code);
}

void gnu_fatal_usage_internal (char *invocation, char *usage, int code)
{
  fprintf (stderr, "usage: %s%s%s\n",
           invocation, usage ? " " : "", usage ? usage : "");
  exit (code);
}

(not used in the example above).  Obviously these would be typically
invoked in very stylized fashion:

  gnu_fatal_usage_external (argv[0], gnu_source_name, -1);
  gnu_fatal_usage_internal (argv[0], gnu_short_usage, -1);

For the more security-conscious, you could uncomment, in which case
help and version would behave like a variant of nm and snorfle the
values out of the binary.

But noooooo!



Home | Main Index | Thread Index

Home Page Mailing List Linux and Japan TLUG Members Links