Skip to content

Commit

Permalink
use click in upgrade
Browse files Browse the repository at this point in the history
  • Loading branch information
cyrillkuettel committed May 14, 2024
1 parent 3663c6b commit 85e74f0
Showing 1 changed file with 3 additions and 17 deletions.
20 changes: 3 additions & 17 deletions src/privatim/cli/upgrade.py
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,9 @@ def commit(self) -> None:
transaction.commit()



@click.command()
@click.argument('config_uri')
@click.option('--dry', is_flag=True, default=False)
def upgrade(args: argparse.Namespace) -> None:

# Extract settings from INI config file.
Expand Down Expand Up @@ -154,19 +156,3 @@ def upgrade(args: argparse.Namespace) -> None:

if not args.dry:
context.commit()


def main() -> None:
parser = argparse.ArgumentParser(description='Runs all upgrade steps')
parser.add_argument('config_uri', help='Config file')
parser.add_argument('-d', '--dry', help='Dry run', action='store_true')
args = parser.parse_args()

if args.dry:
print('Dry run')

upgrade(args)


if __name__ == '__main__':
main()

0 comments on commit 85e74f0

Please sign in to comment.