Compare commits

..

No commits in common. '0da670cb3ec4f6bd423cae0d4f41396b7a59c462' and 'c1fb141c7fb1b0bf5a6a7daf7754302be306e032' have entirely different histories.

  1. 29
      backupill/cli.py

@ -3,30 +3,25 @@ import click
import backupill as bp
@click.argument("file", required=True)
@click.version_option(version=bp.__version__)
@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):
@click.command(context_settings=dict(help_option_names=["-h", "--help"]))
def main(file):
"""
\b
Generates barcoded PDF to backup text files on paper.
Source: https://github.com/beucismis/backupill
\b
Example:
backupill -g filename.asc
backupill -r filename.pdf
"""
if generate and not restore:
bp.generate_backup(click.format_filename(filename))
click.echo("Backup done!")
if restore and not generate:
bp.restore_backup(click.format_filename(filename))
click.echo("Restore done!")
if file:
if not os.path.isfile(file):
click.echo("Error: File '{}' not found!".format(file))
exit()
bp.generate_backup(file)
click.echo("Done!")
else:
click.echo("Usage: packupill FILENAME.asc")
if __name__ == "__main__":

Loading…
Cancel
Save