pcp
[Top] [All Lists]

pcp updates: pmgetopt

To: pcp@xxxxxxxxxxx
Subject: pcp updates: pmgetopt
From: Nathan Scott <nathans@xxxxxxxxxx>
Date: Mon, 5 May 2014 01:10:41 -0400 (EDT)
Delivered-to: pcp@xxxxxxxxxxx
In-reply-to: <1798384154.504691.1399266376367.JavaMail.zimbra@xxxxxxxxxx>
Reply-to: Nathan Scott <nathans@xxxxxxxxxx>
Thread-index: q8YDaVisOx26At4reSylgyl1xSz+zw==
Thread-topic: pcp updates: pmgetopt
(Especially for you to review Ken, or should I say, Captain Shell Script!
This now works, for example:  pcp --host verge --pmie)

Changes committed to git://git.performancecopilot.org/pcp.git dev

 CHANGELOG                   |   22 ++
 man/man1/pmgetopt.1         |  218 ++++++++++++++++++++
 qa/738.out                  |   14 +
 qa/978                      |   93 ++++++++
 qa/978.out                  |   63 +++++
 qa/group                    |    1 
 qa/src/getoptions.c         |    2 
 src/GNUmakefile             |    2 
 src/libpcp/src/getopt.c     |    2 
 src/pcp/pcp.sh              |  153 ++++++++------
 src/pmconfig/pmconfig.c     |   25 --
 src/pmgetopt/.gitignore     |    1 
 src/pmgetopt/GNUmakefile    |   31 ++
 src/pmgetopt/pmgetopt.c     |  466 ++++++++++++++++++++++++++++++++++++++++++++
 src/pmlogger/pmlogmv.sh     |   49 +++-
 src/pmlogger/src/pmlogger.c |    2 
 src/pmval/pmval.c           |    4 
 17 files changed, 1047 insertions(+), 101 deletions(-)

commit c5ca16fa64782483e04f277c072d46a2b061066a
Author: Nathan Scott <nathans@xxxxxxxxxx>
Date:   Mon May 5 15:03:19 2014 +1000

    Update the CHANGELOG with the story so far for this release

commit 9b24739c43e9626f0a256e661ca2b1fb776d787b
Author: Nathan Scott <nathans@xxxxxxxxxx>
Date:   Mon May 5 15:02:04 2014 +1000

    Use simpler shell-quoting mechanism in pmconfig(1) from getopt(1)

commit 2f2df6fe3693cf728cb45d2d8efb616eaa992a7d
Author: Nathan Scott <nathans@xxxxxxxxxx>
Date:   Mon May 5 15:01:03 2014 +1000

    Add a pmgetopt(1) command for shell scripts long option parsing
    
    Inspired by getopt(1), this commit adds a pmgetopt(1) for PCP shell
    scripts to acquire cross-platform long option argument handling, in
    addition to their existing short option forms.  Its output matches
    closely with the quoted variant of the getopt(1) output, however it
    differs significantly wrt configuration.  It also differs in that
    it can be asked to call on pmUsageMessage(3) to generate the usage
    message for the script.
    
    Instead of an arcane combination of command line options to specify
    both long and short options, a usage-message-alike configuration
    syntax is implemented.  This aids conversion of our existing shell
    scripts, since they have usage messages already.  It does imply the
    use of temporary files for configuration but we make such extensive
    use of such files already that I figure thats not a big problem for
    PCP (though it likely would have been for the folks who originally
    wrote the getopt(1) command).  This also gives opportunity to sneak
    in short-cuts for specifying the "standard" PCPIntro(1) options.
    
    A man page and test qa/978 are added to document and test it.  Also
    the pcp(1) and pmlogmv(1) scripts have been initially converted to
    demonstrate and further exercise its use.

commit 01a865d5f37177703d9381844354e76c961fa3a9
Author: Nathan Scott <nathans@xxxxxxxxxx>
Date:   Mon May 5 10:40:17 2014 +1000

    Skip arg errors when simply requesting a usage message (pmlogger/pmval)

<Prev in Thread] Current Thread [Next in Thread>
  • pcp updates: pmgetopt, Nathan Scott <=