mirror of
ssh://git.janware.com/janware/proj/jw-pkg
synced 2026-04-24 09:13:37 +02:00
jw.pkg.cmds.projects.CmdGetAuthInfo: --remote-owner-base
Support --remote-owner-base in the command CmdGetAuthInfo. Make it return what currently --remote-base returned: A URL including the user / organization specific prefix of the Git remote's URL that jw-pkg was pulled from. https://my-company.com/src/theowner/jw-pkg.git would have a --remote-owner-base of https://my-company.com/src/theowner Also, change what --remote-base returns to https://my-company.com/src Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
parent
8dcaa1a6a1
commit
11379f4830
1 changed files with 13 additions and 5 deletions
|
|
@ -16,10 +16,16 @@ class CmdGetAuthInfo(Cmd): # export
|
|||
|
||||
def add_arguments(self, parser: ArgumentParser) -> None:
|
||||
super().add_arguments(parser)
|
||||
parser.add_argument('--only-values', help='Don\'t prefix values by "<field-name>="', action='store_true', default=False)
|
||||
parser.add_argument('--username', help='Show user name', action='store_true', default=False)
|
||||
parser.add_argument('--password', help='Show password', action='store_true', default=False)
|
||||
parser.add_argument('--remote-base', help='Show remote base URL', action='store_true', default=False)
|
||||
parser.add_argument('--only-values', default=False, action='store_true',
|
||||
help='Don\'t prefix values by "<field-name>="')
|
||||
parser.add_argument('--username', default=False, action='store_true',
|
||||
help='Show user name')
|
||||
parser.add_argument('--password', default=False, action='store_true',
|
||||
help='Show password')
|
||||
parser.add_argument('--remote-owner-base', default=False, action='store_true',
|
||||
help='Show remote base URL for owner jw-pkg was cloned from')
|
||||
parser.add_argument('--remote-base', default=False, action='store_true',
|
||||
help='Show remote base URL')
|
||||
|
||||
async def _run(self, args: Namespace) -> None:
|
||||
keys = ['username', 'password']
|
||||
|
|
@ -40,7 +46,9 @@ class CmdGetAuthInfo(Cmd): # export
|
|||
base = parsed.geturl()
|
||||
base = re.sub(r'/jw-pkg', '', base)
|
||||
base = re.sub(r'/proj$', '', base)
|
||||
result['remote_base'] = base
|
||||
base = re.sub(r'/proj$', '', base)
|
||||
result['remote_owner_base'] = base
|
||||
result['remote_base'] = os.path.dirname(base)
|
||||
break
|
||||
|
||||
# --- Print results
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue