Skip to content
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

#281 - Multi-file put/get for smb #282

Merged
merged 5 commits into from
May 12, 2024

Conversation

wumb0
Copy link
Contributor

@wumb0 wumb0 commented Apr 28, 2024

#281

I did not test this :)
Can do folder put later if you want.

@NeffIsBack NeffIsBack added the enhancement New feature or request label Apr 28, 2024
@wumb0 wumb0 changed the title add multi-file put, keeping compatibiltiy with old format (tuple) - #281 - Multi-file put/get for smb Apr 28, 2024
@Marshall-Hallenbeck Marshall-Hallenbeck self-assigned this Apr 28, 2024
@Marshall-Hallenbeck
Copy link
Collaborator

Thanks for the PR man! I'll test and update this, the nargs will need to be changed at least, but I'll fix it up. Appreciate the initial work on it!

@wumb0
Copy link
Contributor Author

wumb0 commented Apr 29, 2024

Shouldn't need to change nargs

In [11]: ap = ArgumentParser()

In [12]: ap.add_argument("--put-file", nargs=2, action="append")
Out[12]: _AppendAction(option_strings=['--put-file'], dest='put_file', nargs=2, const=None, default=None, type=None, choices=None, required=False, help=None, metavar=None)

In [13]: ap.parse_args("--put-file asdf fdsa --put-file jkfjdkf hgfdgfd".split())
Out[13]: Namespace(put_file=[['asdf', 'fdsa'], ['jkfjdkf', 'hgfdgfd']])

In [14]: ap.parse_args("--put-file asdf fdsa".split())
Out[14]: Namespace(put_file=[['asdf', 'fdsa']])

Thought it seems like my isinstance(list) logic is invalid. i think i can remove it.

Copy link
Collaborator

@Marshall-Hallenbeck Marshall-Hallenbeck left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

I was originally thinking that you'd pass in pairs into a single --put-file/etc, which is why I figured the nargs would be changed, but this works better I think.

@NeffIsBack
Copy link
Contributor

@wumb0 if you got the time feel free to add the changes to the wiki :)

https://github.com/Pennyw0rth/NetExec-Wiki

Copy link
Contributor

@NeffIsBack NeffIsBack left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@NeffIsBack NeffIsBack merged commit 0cf9d72 into Pennyw0rth:main May 12, 2024
5 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants