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.
29 lines
704 B
29 lines
704 B
import os
|
|
import click
|
|
from backupill import __version__
|
|
|
|
|
|
@click.version_option(version=__version__)
|
|
@click.option("-f", "--file", help="ASC (.asc) file path.")
|
|
@click.command(context_settings=dict(help_option_names=["-h", "--help"]))
|
|
def main(file):
|
|
"""Generates barcoded PDF to backup text files on paper.
|
|
https://github.com/beucismis/backupill
|
|
"""
|
|
|
|
if file:
|
|
import backupill
|
|
|
|
|
|
if not os.path.isfile(file):
|
|
click.echo("File '{}' not found!".format(file))
|
|
exit()
|
|
|
|
backupill.generate_backup(asc_file=file)
|
|
click.echo("Done!")
|
|
else:
|
|
click.echo("Usage: packupill -f FILENAME.asc")
|
|
|
|
|
|
if __name__ == "__main__":
|
|
main()
|
|
|