Mail Archives: cygwin-apps/2002/03/26/23:27:04

Mailing-List: contact cygwin-apps-help AT cygwin DOT com; run by ezmlm
Sender: cygwin-apps-owner AT cygwin DOT com
List-Subscribe: <mailto:cygwin-apps-subscribe AT cygwin DOT com>
List-Archive: <>
List-Post: <mailto:cygwin-apps AT cygwin DOT com>
List-Help: <mailto:cygwin-apps-help AT cygwin DOT com>, <>
Mail-Followup-To: cygwin-apps AT cygwin DOT com
Delivered-To: mailing list cygwin-apps AT cygwin DOT com
content-class: urn:content-classes:message
Subject: Command line options for setup
MIME-Version: 1.0
Date: Wed, 27 Mar 2002 15:26:51 +1100
Message-ID: <>
X-MimeOLE: Produced By Microsoft Exchange V6.0.5762.3
From: "Robert Collins" <robert DOT collins AT itdomain DOT com DOT au>
To: "Cygwin-Apps" <cygwin-apps AT sources DOT redhat DOT com>
Cc: "keith_starsmeare" <kxs AT breathemail DOT net>
X-MIME-Autoconverted: from quoted-printable to 8bit by id g2R4R3V24463

Hi Keith, 
	I hope I haven't stolen your thunder, but I've checked into HEAD
the framework for command line options for setup. I've not used what you
put together, because it was too procedural.

Instead, we have:
GetOption - a singleton class that abstracts the getopt() mechanics.
Each option registers with it at process startup, and main() calls
GetOption::GetInstance().Process(argc, argv);

This means that is completely unaffected by addition and removal
of options.

Secondly, there is an abstract class Option that each option inherits
from (we can probably look at a template at some point). The concrete
classes need to be singletons, to ensure their registration at process
startup. (Their constructor calls

See desktop.h and for a sample option (--no-shortcuts or -n).

Anyway, this will hopefully act as a seed, and allow you (or anyone else
interested in adding command line options) to do so without having to
invent the infrastructure as well.


- Raw text -

  webmaster     delorie software   privacy  
  Copyright 2019   by DJ Delorie     Updated Jul 2019