Browse Source

add "shut -C,--cwd" option

shut
Niklas Rosenstein 10 months ago
parent
commit
f805686d52
No known key found for this signature in database GPG Key ID: 6D269B33D25F6C6
1 changed files with 6 additions and 1 deletions
  1. + 6
    - 1
      src/shore/commands/__init__.py

+ 6
- 1
src/shore/commands/__init__.py

@ -28,15 +28,17 @@ from nr.proxy import Proxy
import click
import logging
import os
context = Proxy(lambda: click.get_current_context().obj)
@click.group()
@click.option('-C', '--cwd', metavar='path', help='Run as if shut was started inside the specified directory.')
@click.option('-v', '--verbose', count=True, help='Increase the log verbosity.')
@click.option('-q', '--quiet', is_flag=True, help='Quiet mode, wins over --verbose.')
@click.version_option(__version__)
def shut(verbose, quiet):
def shut(cwd, verbose, quiet):
"""
Shut is a tool to manage the lifecycle of pure Python packages. It automates tasks such
as bootstrapping a project, bumping version numbers, managing changelogs and publishing
@ -46,6 +48,9 @@ def shut(verbose, quiet):
system of choice is Git.
"""
if cwd:
os.chdir(cwd)
ctx = click.get_current_context()
ctx.ensure_object(dict)
context['quiet'] = quiet

Loading…
Cancel
Save