Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 1044921
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T15:54:19+00:00 2026-05-16T15:54:19+00:00

There are lots of GUI best practices. I am looking for best practices when

  • 0

There are lots of GUI best practices. I am looking for best practices when developing a command line program.

For example, if I were creating a backup program what is best?

Consideration 1, invocation:

program.exe backup

program.exe /backup

program.exe -backup

program.exe –backup

Consideration 2, parameters:

program.exe backup “C:\file1.txt” “C:\file1.bak” (implicit source and destination)

program.exe backup -source “C:\file1.txt” -destination “C:\file1.bak” (explicit)

program.exe backup -source “C:\file1.txt” “C:\file2.txt” “C:\file3.txt” -destination “C:\files.bak” (multiple sources)

program.exe backup -source “C:\file1.txt” -source “C:\file2.txt” -source “C:\file3.txt” -destination “C:\files.bak” (multiple sources, alternative syntax)

Consideration 3, chaining:

program.exe backup “C:\file1.txt” “C:\file1.bak” backup “C:\file2.txt” “C:\file2.bak” (should this be allowed?)

Consideration 4, typing economy:

program.exe backup

program.exe bkp

program.exe b (should all these be aliases to the same command?)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-16T15:54:20+00:00Added an answer on May 16, 2026 at 3:54 pm

    I’d always prefer what’s (in order of importance from most to least):

    • Most understandable by the end user
    • Least ambiguous
    • Follows the conventions of the platform being coded against
    • Easiest to parse in my code

    So on Windows I’d go for / as the prefix (follows the conventions), /source and /destination (most understandable AND least ambiguous) and not allow chaining as that makes for parsing complexity, so:

    program.exe /backup /source:”c:\source” /destination:”c:\destination”

    By all means also permit abbreviated versions of the parameter names, so you could allow the above to be shrunk down to:

    program.exe /b /s:”c:\source” /d:”c:\destination”

    But don’t make it any more arcane than that. Also, include a /? parameter that can be used to list the syntax for your program. As Peter M pointed out in the comments on my answer, it’s a good idea to do the same as /? when the user calls your program without specifying any parameters. Nothing’s less helpful and more frustratingly useless than running a CLI program and receiving:

    Program Name v1.01

    No parameters specified, use /? for help

    One other important thing to consider, tied to the final point, would be: don’t reinvent the wheel. There are innumerable Command Line Parsers out there, take a look at the answers to this question for a starting point (if you’re using C# targeting Windows). Don’t do a mediocre job of doing something that someone else has already done a good job of doing.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In my Qt GUI application, I am calling the command prompt through: system(lots.exe &
There are lots of tools for creating installers on Windows (InstallShield, InnoSetup, NSIS, just
There are lots of descendants of Mage_Eav_Model_Entity_Setup for example class Mage_Checkout_Model_Resource_Setup extends Mage_Eav_Model_Entity_Setup {
There's lots of questions on SO related to this, but the ones I scanned
There's lots of good material on Design Patterns out there that covers how you
There are lots of implementations for validating Luhn checksums but very few for generating
There are lots of Fluent implementations out there now that work with Lambdas to
There are lots of java apps on my simulator menu screen which I have
There are lots of tutorials/instructions on how to embed python in an application, but
There are lots written about the ReaderWriterLockSlim class which allows multiple read and a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.