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

  • Home
  • SEARCH
  • 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 6323557
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T16:32:29+00:00 2026-05-24T16:32:29+00:00

I am writing a command-line plugin-based program where the plugins will provide additional functionality

  • 0

I am writing a command-line plugin-based program where the plugins will provide additional functionality on top of whatever I provide.

So for example suppose I wrote a simple script that parsed images and stored them, and that’s all I do. Then someone else can write a set of scripts to manipulate the image, putting his scripts in a plugin.

The plugin would be loaded and users can access the plugin by specifying its name in the command line.

It is not uncommon for scripts to want to provide additional options for the user.
So suppose in some years, 20 different plugins have been written.

Now, all of the authors want to allow users to provide options, so the main engine should take the user’s options and pass them to the plugin so that it can handle them however it wants.

To keep it uniform, they might agree that certain options should perform a similar operation. Like “-o name” should set the output name to “name”. They would then go about implementing their own options and stuff, which the main engine does not know about (of course, it shouldn’t know what the plugins do)

I am using the deprecated getopt module, and it will throw exceptions whenever I specify an undefined option. I have heard of optparse and argparse, but I am not sure if these will allow the user to specify any options he wants without the code throwing an exception.

How can I make it so I can specify any command-line option?

  • 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-24T16:32:31+00:00Added an answer on May 24, 2026 at 4:32 pm

    argparse lets you partially parse an argument list with the parse_known_args method, returning what was parsed correctly, together with a list of the remaining arguments.

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

Sidebar

Related Questions

I'm writing some code that uses dynamic shared libraries as plugins. My command line
I am writing a plugin for Jira which involves parsing of XML documents. I
I am writing a MacFuse plugin, and would like finder to use the appropriate
I'm writing a plugin for my wordpress site and am having trouble understanding the
I'm writing a java app using eclipse which references a few external jars and
I am looking to start writing a sophisticated application in JavaScript to run on
I've been interested in D for a couple of years now and recently decided
I had installed Eclipse 3.5 Yoxos on my Ubuntu 8.04 for month, and run
I've recently been asked to mavenize an existing project, and I don't know exactly
Problem : I have a hand held device that scans those graphic color barcodes

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.