This is the mail archive of the frysk@sourceware.org mailing list for the frysk project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: Command line utilities argument types.


Nurdin Premji wrote:
Andrew Cagney wrote:
Nurdin Premji wrote:
I'm going to be refactoring how the command line utilities will parse their arguments to make them as unified as possible.

I've identified 4 types of input that can be passed to a command line utility: Pids, Core files, a command (executable with options), or nothing.

Would these be reported using a callback-interface?


That is a great idea. I will use 3 callbacks to notify of pids, cores, and commands.
I'm thinking
parsePid (ProcId pid)
parseCore (File core)
parseCommand (String[] command)


I don't know whether the first two should return a single pid/core and be called once for every pid/core found or arrays of pid/cores and only be called once. The third callback would only ever be called once.
I have extended CommandLineParser in frysk.util to do the above, with callbacks parsePids(ProcId[] pids) parseCores(File[] coreFiles) and parseCommand(String[] command).

A CommandLineParser will call only one of these three callback functions. (There is no mixing of pids with cores withs commands.)


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]