SSW Foursquare

Rules to Better Command Lines - 3 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 /?

We open source. Powered by GitHub