Skip to content

Fix #24: Migrate FuseArgs away from using Optparse #95

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

lonetwin
Copy link

@lonetwin lonetwin commented Mar 29, 2025

This PR addresses #24. It replaces the Optpase based implementation of FuseArgs to one based on ArgumentParser and also adds some tests for the parsing functionality.

This is the first of a 3-patch series of commits to address libfuse#24

This commit introduces tests for the current `Optparse` based implementation
to ensure that the next commit doesn't break current usage compatibility.

The next commit would introduce the `ArgumentParser` based implementation. The
final commit will attempt to do some minor clean up to make the code a bit
more idomatic / pythonic.
This PR changes the `Optparse` based implementation to one base on
`ArgumentParser` for `FuseArgs`, without touching the tests introduced
in the previous commit. We delete the `subbedopts` sub-module and
implemented all of the argument parsing/handling in the main
Fuse/FuseArgs implementation.
@lonetwin lonetwin changed the title issue 24 Migrate FuseArgs away from using Optparse #24 Mar 29, 2025
@lonetwin
Copy link
Author

The PR is split into distinct commits:

  • The first that introduces the tests, without any modification to the code.
  • The second that migrates the code, without any modification to the tests.

This ensures that we maintain backwards compatibility. I could break these into 2 separate PRs if that would be easier to review / track.

@lonetwin lonetwin changed the title Migrate FuseArgs away from using Optparse #24 Fix #24: Migrate FuseArgs away from using Optparse Mar 29, 2025
@lonetwin lonetwin marked this pull request as draft March 29, 2025 19:07
@lonetwin
Copy link
Author

lonetwin commented Mar 29, 2025

Seems like there's a bit more work left on this w.r.t parsing strings that have implicit arguments such as %prog. Will update this soon. Just for reference, there's a howto in the latest python docs to cross-check against.

Aside: It might seem like we'd have to add some deprecation messages for code that relies on OptParse behavior.

@lonetwin lonetwin marked this pull request as ready for review March 29, 2025 19:19
@sdelafond
Copy link
Collaborator

Thanks, that looks promising. Please fix the tests that fail to now start in the CI, and we'll then take it from there.

@sdelafond
Copy link
Collaborator

@lonetwin can you please rebase on master?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants