[mirror] Generates barcoded PDF to backup text files on paper
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

34 lines
1014 B

3 years ago
import os
import click
3 years ago
import backupill as bp
3 years ago
3 years ago
@click.version_option(version=bp.__version__)
3 years ago
@click.option("--verbose", is_flag=1, help="Will print verbose messages.")
@click.option("-r", "--restore", is_flag=1, help="Restore PDF backup file.")
@click.option("-g", "--generate", is_flag=1, help="Generate PDF backup file.")
@click.argument("filename", type=click.Path(exists=1))
@click.command(context_settings=dict(help_option_names=["--help"]))
def main(generate, restore, verbose, filename):
"""
\b
Generates barcoded PDF to backup text files on paper.
Source: https://github.com/beucismis/backupill
3 years ago
3 years ago
\b
Example:
backupill -g filename.asc
backupill -r filename.pdf
"""
3 years ago
3 years ago
if generate and not restore:
bp.generate_backup(click.format_filename(filename))
click.echo("Backup done!")
3 years ago
if restore and not generate:
bp.restore_backup(click.format_filename(filename))
click.echo("Restore done!")
3 years ago
if __name__ == "__main__":
main()