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

Show user and url in profile command #34

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions synophotos/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@

synophotos: Optional[SynoPhotos] = None # global variable for functions below

no_login_commands = [ 'init', 'version' ]
no_login_commands = [ 'init', 'profile', 'version' ]

@group
@option( '-d', '--debug', is_flag=True, required=False, default=False, help='outputs debug information (implies --verbose)' )
Expand Down Expand Up @@ -311,7 +311,8 @@ def version( ctx: ApplicationContext ):
@cli.command( 'profile', help='shows the name of the currently active profile' )
@pass_obj
def profile( ctx: ApplicationContext ):
pp( ctx.config.profile )
pn, p = ctx.config.profile, ctx.config.profiles.get( ctx.config.profile )
pp( f'{pn} ( {p.account} at {p.url} )' )

def _ws( ctx: ApplicationContext ) -> SynoPhotos:
return cast( SynoPhotos, ctx.service )
Expand Down