Advertisement

CLOPS: A DSL for Command Line Options

  • Mikoláš Janota
  • Fintan Fairmichael
  • Viliam Holub
  • Radu Grigore
  • Julien Charles
  • Dermot Cochran
  • Joseph R. Kiniry
Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 5658)

Abstract

Programmers often write custom parsers for the command line input of their programs. They do so, in part, because they believe that both their program’s parameterization and their option formats are simple. But as the program evolves, so does the parameterization and the available options. Gradually, option parsing, data structure complexity, and maintenance of related program documentation becomes unwieldy. This article introduces a novel DSL called CLOPS that lets a programmer specify command line options and their complex inter-dependencies in a declarative fashion. The DSL is supported by a tool that generates the following features to support command line option processing: (1) data structures to represent option values, (2) a command line parser that performs validity checks, and (3) command line documentation. We have exercised CLOPS by specifying the options of a small set of programs like ls, gzip, and svn which have complex command line interfaces. These examples are provided with the Open Source release of the CLOPS system.

Keywords

Command Line Software Product Line Validity Function Compression Level Validity Rule 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.

References

  1. 1.
  2. 2.
    Batory, D.: Feature models, grammars, and propositional formulas. In: Obbink, H., Pohl, K. (eds.) SPLC 2005. LNCS, vol. 3714, pp. 7–20. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  3. 3.
    Batory, D., O’Malley, S.: The design and implementation of hierarchical software systems with reusable components. ACM Transactions on Software Engineering and Methodology (1992)Google Scholar
  4. 4.
    Clarke, D.G., Potter, J.M., Noble, J.: Ownership types for flexible alias protection. SIGPLAN Not. 33(10), 48–64 (1998)CrossRefzbMATHGoogle Scholar
  5. 5.
    Clements, P., Northrop, L.: Software Product Lines: Practices and Patterns. Addison-Wesley Publishing Company, Reading (2002)Google Scholar
  6. 6.
    The Apache Commons CLI library, http://commons.apache.org/cli/
  7. 7.
    Darvas, A., Muller, P.: Reasoning about method calls in JML specifications. In: Formal Techniques for Java-like Programs (2005)Google Scholar
  8. 8.
    JCommando: Java command-line parser, http://jcommando.sourceforge.net/
  9. 9.
  10. 10.
    JSAP: The Java Simple Argument Parser, http://www.martiansoftware.com/jsap/
  11. 11.
    Kang, K.C., Cohen, S.G., Hess, J.A., Novak, W.E., Spencer Peterson, A.: Feature-oriented domain analysis (FODA), feasibility study. Technical Report CMU/SEI-90-TR-021, SEI, Carnegie Mellon University (November 1990)Google Scholar
  12. 12.
    Leavens, G.T., Baker, A.L., Ruby, C.: JML: A Notation for Detailed Design. In: Behavioral Specifications of Business and Systems, pp. 175–188. Kluwer Academic Publishing, Dordrecht (1999)CrossRefGoogle Scholar
  13. 13.
    Svahnberg, M., Van Gurp, J., Bosch, J.: A taxonomy of variability realization techniques. Software-Practice and Experience 35(8), 705–754 (2005)CrossRefGoogle Scholar
  14. 14.
    van Deursen, A., Klint, P., Visser, J.: Domain-specific languages: an annotated bibliography. SIGPLAN Not. 35(6), 26–36 (2000)CrossRefGoogle Scholar
  15. 15.
    The Apache Velocity Project, http://velocity.apache.org/

Copyright information

© IFIP International Federation for Information Processing 2009

Authors and Affiliations

  • Mikoláš Janota
    • 1
  • Fintan Fairmichael
    • 1
  • Viliam Holub
    • 1
  • Radu Grigore
    • 1
  • Julien Charles
    • 1
  • Dermot Cochran
    • 1
  • Joseph R. Kiniry
    • 1
  1. 1.School of Computer Science and Informatics, Lero — The Irish Software Engineering Research Centre, and The Complex and Adaptive Systems Laboratory (CASL)University College DublinIreland

Personalised recommendations