Rules to Better Command Lines

Enhance your command line utilities with effective design and organization principles. This collection of rules provides guidance on creating user-friendly interfaces, managing terminal sessions, and optimizing argument lists for improved functionality.

  1. There should never be a command line utility without a UI. Take an example of Visual Studio 2008:

  2. It is always a good practice to have UI opened when specifying \[ApplicationName].exe from command line. If the GUI is not done, show a messagebox "GUI coming...".

    Note: If you prefer for not putting UI as the default, it should have be at least "/GUI" as the argument. Do not use "/i", because too many command lines are using “/i” already.

  3. When you develop an application that supports command line, you must provide a list of arguments / help on how to use the application through command line.

    It can be as easy as typing: \[ApplicationName].exe /? for listing the arguments.

  4. When building command line applications in .NET, you need a framework that makes argument parsing, validation, and help generation simple and intuitive. Cocona is a lightweight and powerful framework that turns your C# methods into fully-featured CLI commands with minimal boilerplate code.

    Cocona has many built-in features that make it feel familiar to .NET developers.

    Why use Cocona?

    Cocona offers several advantages over manual argument parsing or other CLI frameworks:

    • Simple and intuitive: Transform regular C# methods into CLI commands
    • Automatic help generation: Built-in help text and usage information
    • Type safety: Strong typing for command parameters and options
    • Dependency injection: Built-in DI container support
    • Validation support: Integration with data annotations for parameter validation
    • Async support: First-class support for async/await patterns
    • Multiple commands: Easy support for sub-commands and complex CLI structures
  5. Windows Terminal is a modern terminal application that allows users to manage multiple command-line tools from a single interface. One standout feature is the ability to split the main window into multiple panes, enabling the running and viewing of multiple sessions side by side within a single window.

per page
1 - 5 of 5 items
We open source.Loving SSW Rules? Star us on GitHub. Star