Add the ability to add additional identities via the command line#413
Open
rustafariandev wants to merge 1 commit intoromanz:masterfrom
Open
Add the ability to add additional identities via the command line#413rustafariandev wants to merge 1 commit intoromanz:masterfrom
rustafariandev wants to merge 1 commit intoromanz:masterfrom
Conversation
502e578 to
eab0362
Compare
romanz
requested changes
Feb 2, 2023
| @@ -114,6 +114,10 @@ def create_agent_parser(device_type): | |||
|
|
|||
| p.add_argument('identity', type=_to_unicode, default=None, | |||
Owner
There was a problem hiding this comment.
I think it would be simpler to add nargs='+' to the existing identity argument:
p.add_argument('identity', type=_to_unicode, default=None, nargs='+',
help='proto://[user@]host[:port][/path]')
Author
There was a problem hiding this comment.
Let me test how that works.
Author
|
That conflicts with the other nargs argument at trezor-agent/libagent/ssh/__init__.py Line 121 in eab0362 import argparse
parser = argparse.ArgumentParser()
parser.add_argument('-c', action='store_true')
parser.add_argument('foo', nargs='+')
parser.add_argument('bar', nargs='*', metavar='ARGUMENT')
print(parser.parse_args('-c c a b -- 1 2 3'.split()))The output Namespace(c=True, foo=['c', 'a', 'b', '1', '2', '3'], bar=[]) |
Owner
|
You're right - it won't work :( |
Owner
Author
|
Yes, I can. This was more for convenience than anything else. onlykey-agent <(echo "<git@github.com|ed25519>";echo "<user@example.com|ed25519>") --shellOr creating the file ahead of time. The file approach also works. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.