SSW Foursquare

Rules to Better Command Lines - 4 Rules

  1. Do you have a UI for a command line utility?

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

    commandlinewithoutui
    Figure: Bad example - In website project, Visual Studio does not have a UI for its command line

    commandlinewithui
    Figure: Good example - In web application project, Visual Studio provides a UI for its command line

  2. Do you open UI by default when you type [ApplicationName].exe?

    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.

    commandlineopenuiwithargument
    Figure: Bad example - /i should not be needed to get to the GUI – it should be by default

    commandlineopenuiwithoutargument
    Figure: Good example - UI is opened by default

  3. Do you provide list of arguments?

    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.

    nolistofarguments
    Figure: Bad example - Do no provide supported argument through /?

    listofarguments
    Figure: Good example - Provide supported argument through /?

  4. Do you organize your terminal sessions using Windows Terminal panes?

    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.

    This feature serves as an alternative to having multiple terminal windows open simultaneously. Panes help keep everything in one place, making it simpler to navigate between different sessions.

    multiple windows
    Figure: APIs and front-end applications running in different windows

    one window
    Figure: APIs and front-end applications running in panes

    Use cases:

    • Monitoring different processes simultaneously
    • Running multiple projects locally
    • Executing commands concurrently

    Main shortcuts:

    • Alt + Shift + +: to split the pane vertically
    • Alt + Shift + -: to split the pane horizontally
    • Alt + Shift + W: to close the pane
    • Alt + Arrow: to move between panes
    • Alt + Shift + Arrow: to resize a pane
We open source. Powered by GitHub